2012年4月16日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4223View Code #include <stdio.h>#include <stdlib.h>#include <string.h>#define INF 100000000int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int a[110000],s[110000];int main(){ int t,n; int i; int min; int nCase=1; scanf("% 阅读全文
posted @ 2012-04-16 21:46 LegendaryAC 阅读(187) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1003靠,总算过了,不解释View Code #include <stdio.h>#include <stdlib.h>int a[110000];int main(){ int t,n; int i,f; int max,now; int start,end; int temp; int nCase=1; scanf("%d",&t); f=0; while(t--) { scanf("%d",&n); scanf(" 阅读全文
posted @ 2012-04-16 18:47 LegendaryAC 阅读(130) 评论(0) 推荐(0) 编辑

2012年4月15日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4221哎,这么简单一道题,愁View Code #include <stdio.h>#include <stdlib.h>typedef struct L{ __int64 c,d;}L;L kk[110000];int cmp(const void*a,const void*b){ return (*(L*)a).d-(*(L*)b).d;}int main(){ int t,n; int i; __int64 time,py; int nCase=1; scanf... 阅读全文
posted @ 2012-04-15 21:13 LegendaryAC 阅读(202) 评论(0) 推荐(0) 编辑

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) 编辑

2012年4月13日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2108几何计算,判断线段的转向。View Code #include <stdio.h>#include <string.h>#include <math.h>typedef struct point{ int x,y; }point;point kk[100000];int dis(point p1,point p2,point p3){ return (p3.x-p1.x)*(p2.y-p1.y)-(p2.x-p1.x)*(p3.y-p1.y);}int main(){ 阅读全文
posted @ 2012-04-13 23:29 LegendaryAC 阅读(182) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3783View Code #include <stdio.h>#include <stdlib.h>#include <string.h> int main(){ int n,i; int cntZ,cntO,cntJ; int len; char str[200]; while(gets(str)) { if(str[0]=='E')break; len=strlen(str); cntZ=cntO=cntJ=0; ... 阅读全文
posted @ 2012-04-13 22:31 LegendaryAC 阅读(221) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3782View Code #include <stdio.h>#include <stdlib.h>int main(){ int n; while(scanf("%d",&n),n) { int cnt=0; while(1) { if(n==1)break; if(n&1) n=(3*n+1)>>1; else n>>=1... 阅读全文
posted @ 2012-04-13 22:07 LegendaryAC 阅读(152) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3785View Code #include <stdio.h>#include <stdlib.h>#define INF 200000000int cmp(const void*a,const void*b){ return *(int*)b-*(int*)a;}int a[110000];int main(){ int n,m; while(scanf("%d%d",&n,&m),(n||m)) { for(int i=0;i<100001 阅读全文
posted @ 2012-04-13 22:02 LegendaryAC 阅读(214) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2399最短路最小生成树神马的几道题纠结了几个小时,换换心情吧。直接按题目要求做。View Code #include <stdio.h>#include <string.h>int main(){ char str[300]; int len,i; int s,f,cnt; while(gets(str)) { len=strlen(str); s=f=cnt=0; for(i=0;i<len;i++) { ... 阅读全文
posted @ 2012-04-13 13:49 LegendaryAC 阅读(394) 评论(0) 推荐(0) 编辑