andre_joy

导航

2012年6月30日

hdu 2523

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2523题意:中文……mark:数据范围只是0-2000,直接桶排序,然后简单搜索。代码:#include <stdio.h>#include <string.h>int fab(int a) {return a < 0 ? -1*a : a;}int a[1010],b[2010];int main(){ int c,n,k; int i,j,f; scanf("%d", &c); while(c-- && scanf(" 阅读全文

posted @ 2012-06-30 23:28 andre_joy 阅读(110) 评论(0) 推荐(0) 编辑

hdu 2521

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2521题意:中文……mark:数据较少,直接暴力破解,0ms。代码:#include <stdio.h>int m[5010];int main(){ int t,a,b,max; for(a = 2; a < 5001; a++) for(b = a; b < 5001; b += a) m[b]++; scanf("%d", &t); while(t-- && scanf("%d%d", &a, & 阅读全文

posted @ 2012-06-30 23:14 andre_joy 阅读(76) 评论(0) 推荐(0) 编辑

hdu 1850

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1850题意:中文……mark:wa了一次,一开始直接用n!公式了。。10!就是100w了!用杨辉三角做~代码:#include <stdio.h>int main(){ int t,a,b,m[30][31]={1,1}; for(a = 1; a < 30; a++) { m[a][0] = 1; for(b = 1; b < a+1; b++) m[a][b] = m[a-1][b-1] + m[a-1][b]; m[... 阅读全文

posted @ 2012-06-30 20:51 andre_joy 阅读(87) 评论(0) 推荐(0) 编辑

hdu 1701

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1701题意:求两个百分数对应的人数不想等的最小总人数。(纯属扯淡的题目。。。)mark:简单搜索。代码:#include <stdio.h>int main(){ int n,i; double a,b; scanf("%d", &n); while(n-- && scanf("%lf%lf", &a, &b)) { for(i = 2; i < 10000; i++) if((int)(i*a/100.0 阅读全文

posted @ 2012-06-30 20:20 andre_joy 阅读(81) 评论(0) 推荐(0) 编辑

hdu 2537

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2537题意:打台球,一人一次机会(明显不符合实际。。。)mark:扫描一遍~代码:#include <stdio.h>int main(){ int t,i,r,y,f; char a[20]; while(scanf("%d", &t), t) { scanf("%s", a); r = y = 7; for(i = f = 0; a[i]; i++) { if(a[i] == 'R') r--; ... 阅读全文

posted @ 2012-06-30 19:51 andre_joy 阅读(82) 评论(0) 推荐(0) 编辑