2012年4月4日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2673排序题,汗。。。View Code #include <stdio.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int a[11000];int main() { int n; int i,f,cnt1,cnt2; while(~scanf("%d",&n)) { for(i=0;i<n;i++) scanf("%d 阅读全文
posted @ 2012-04-04 13:18 LegendaryAC 阅读(249) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2674n大于等于2009时取余为0,只要算2009前面的就okView Code #include <stdio.h>#include <stdlib.h>int main() { int n; int ans,i; while(~scanf("%d",&n)) { ans=1; if(n>=2009) printf("0\n"); else { for(i=1;i<=n;i++) ... 阅读全文
posted @ 2012-04-04 13:05 LegendaryAC 阅读(239) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.bjtu.edu.cn/problem/detail?pid=1623贪心,关键点是以课程的结束时间为标准排序View Code #include <stdio.h>#include <stdlib.h>struct node{ __int64 x,y;}kk[110000];int cmp(const void*a,const void*b){ struct node*c=(struct node*)a; struct node*d=(struct node*)b; if(d->y==c->y) return d->x-c-&g 阅读全文
posted @ 2012-04-04 12:40 LegendaryAC 阅读(197) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2570这道题WA了十多次,百思不得其解,百度了一组数据12 1 65 7实数运算一定要修正误差View Code #include <stdio.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int main() { int t,n,cnt; int v,w,p[200]; int i,j,f; double q,rz,ry; scanf("%d" 阅读全文
posted @ 2012-04-04 11:44 LegendaryAC 阅读(519) 评论(0) 推荐(0) 编辑