贪心算法
Fenice
狂奔的蜗牛
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu1009贪心
#include #include #include using namespace std;int M,N;typedef struct { float J; float F; double Aver;}room;room Rooms[3001];int Cmp(const room a,const room b){原创 2012-11-30 15:13:18 · 643 阅读 · 0 评论 -
hdu 2037贪心
#include #include using namespace std;struct ss{ int st; int ed;}node[110];//按电视节目结束时间排序 bool cmp(ss s1,ss s2){ return s1.ed < s2.ed || (s1.ed == s2.ed && s1.st < s2.st);原创 2013-01-05 01:01:21 · 650 阅读 · 0 评论 -
hdu 1052贪心算法
//贪心算法//稍有点麻烦,要分析一下各种情况#include #include using namespace std;int n;int Sp_A[1001];int Sp_B[1001];bool cmp(int x,int y){ return x > y;}int main(){ while(cin>>n) { i原创 2013-01-05 02:52:57 · 915 阅读 · 0 评论 -
hdu1051贪心
#include #include #include using namespace std;int T;int n;typedef struct{ int l; int w;}stick;int cmp(stick a,stick b) //这个函数写错了很多次,坑的一笔,找个时间要好好看看{ if(a.l == b.l) { return a.w < b.w原创 2013-03-03 01:21:51 · 750 阅读 · 0 评论 -
USACO barn1
//这题大概是一道贪心,我是/*ID:kevin_s1PROG:barn1LANG:C++*/#include #include #include #include #include #include #include #include #include #include #include using namespace std;int cmp(int a,原创 2014-05-14 01:10:21 · 891 阅读 · 0 评论 -
USACO milk
/*ID:kevin_s1PROG:milkLANG:C++*/#include #include #include #include #include #define MAXN 5001using namespace std;int N,M;struct farmer{ int Pi; int Ai;}farmers[MAXN];int cmp(farm原创 2014-05-13 00:27:38 · 1149 阅读 · 0 评论
分享