2012年4月14日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1205max为最大堆数量,s为总数。保证max-(s-max)=2*max-s<=1即可,因为只要能保证最大堆数量和其他堆数量差在一个以内,就可以做到别的堆拿一个最大堆拿一个(剩下yy)这种操作。View Code #include <stdio.h>int a[1100000];int main(){ int t,n; int i; __int64 s; int max; scanf("%d",&t); while(t--) { s=max=0; ... 阅读全文
posted @ 2012-04-14 19:08 LegendaryAC 阅读(384) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2540只要影子长度大于前面的所有影子长度就okView Code #include <stdio.h>#include <stdlib.h>typedef struct node{ int x,h;}node;node kk[110000];int cmp(const void*a,const void*b){ return (*(node*)a).x-(*(node*)b).x;}int main(){ int n,i; int A,T; while(scanf("%d&q 阅读全文
posted @ 2012-04-14 10:16 LegendaryAC 阅读(217) 评论(0) 推荐(0) 编辑