andre_joy

导航

上一页 1 ··· 11 12 13 14 15

2012年7月1日

hdu 1408

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1408题意:中文……mark:wa了一次。。主要是精度问题,要判断好究竟滴多少次。代码:#include <stdio.h>int main(){ double v,d; int i,sum,m; while(~scanf("%lf%lf", &v, &d)) { sum = 0; if((int(v/d))*10 == (int)(v/d*10)) m = (int)(v/d); else m = (int)(v/d) + 1; ... 阅读全文

posted @ 2012-07-01 01:19 andre_joy 阅读(76) 评论(0) 推荐(0) 编辑

hdu 2522

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2522题意:中文……mark:真是2死了,wa了5次。开始是因为数组开小了,因为余数是在n*10的范围内的,所以数组要开10^6。后来是因为给a[]初始化的时候,n应该先转换成正数,结果一直wa。。。此题是模仿除法运算,每一步输出一个结果。代码:#include <stdio.h>int a[1000010];int main(){ int t,n,m; scanf("%d", &t); while(t-- && scanf("%d&qu 阅读全文

posted @ 2012-07-01 00:46 andre_joy 阅读(146) 评论(0) 推荐(0) 编辑

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

上一页 1 ··· 11 12 13 14 15