随笔分类 -  贪心

贪心_简单直接贪心[优先队列](HDU_1009)
摘要:#include #include #include using namespace std;#define M 1002struct node { int j,f; node(int _j,int _f) { j = _j; f = _f; } friend bool operator q;int main(int argc, char* argv[]){ #ifdef __MYLOCAL freopen("in.txt","r",stdin); #endif int m,n,Ji,Fi; double s; ... 阅读全文
posted @ 2013-08-15 09:57 lk1993 阅读(167) 评论(0) 推荐(0)
贪心_简单直接贪心(HDU_1009)
摘要:#include#includeusing namespace std;#define M 1002struct node{ int j,f;};struct node jf[M];bool cmp(const node &a,const node &b){ return 1.0 * a.j / a.f > 1.0 * b.j / b.f;}int main(){// freopen("in.txt","r",stdin); int m,n; double s; while(scanf("%d%d",&m 阅读全文
posted @ 2013-08-15 09:56 lk1993 阅读(194) 评论(0) 推荐(0)