摘要:
代码如下:#include"stdio.h"#include"string.h"#include"stdlib.h"int flag[1005];struct node{ int date,score;}x[1005];int cmp(const void *a,const void *b){ node *aa=(node*)a,*bb=(node*)b; if(aa->score!=bb->score) return bb->score-aa->score; else return aa->date-b 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1051这题思路跟1257那道差不多。。。半贪心半dp代码如下:#include"stdio.h"#include"stdlib.h"int a[5005][2],w[5005][2];struct node { int x,y;}bar[5005];int cmp(const void *a,const void *b){ node *aa=(node*)a,*bb=(node*)b; if(aa->x!=bb->x) return aa->x-bb- 阅读全文