上一页 1 ··· 4 5 6 7 8
摘要: The Famous Clock时间限制:1000 ms | 内存限制:65535 KB难度:1描述Mr. B, Mr. G and Mr. M are now in Warsaw, Poland, for the 2012’s ACM-ICPC World Finals Contest. They’ve decided to take a 5 hours training every day before the contest. Also, they plan to start training at 10:00 each day since the World Final Contest 阅读全文
posted @ 2013-07-26 20:42 王莜轩 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, output SUM(n) in one line, followed by a blank lin 阅读全文
posted @ 2013-07-26 20:09 王莜轩 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 小光棍数时间限制:1000 ms | 内存限制:65535 KB难度:1描述最近Topcoder的XD遇到了一个难题,倘若一个数的三次方的后三位是111,他把这样的数称为小光棍数。他已经知道了第一个小光棍数是471,471的三次方是104487111,现在他想知道第m(mint main(){ int n; long long m; scanf("%d",&n); while(n--) { scanf("%lld",&m); printf("%lld\n",(m-1)*1000+471); } return 0;}这次 阅读全文
posted @ 2013-07-26 19:31 王莜轩 阅读(178) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ int t; scanf("%d",&t); while(t--) { long int h,n; scanf("%ld",&h); if(h<=5) printf("%ld\n",h/h); else { if(h%5==0) printf("%ld\n",h/5-1); else printf("%ld\n",h/5); } } return 0;}这是奋斗的小蜗牛代码。只要界限分清楚,此题比较容易。 阅读全文
posted @ 2013-07-26 17:44 王莜轩 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 南阳题目477,代码如下:#includeint main(){ int t; scanf("%d",&t); while(t--) { double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); if(a+b-c>-0.0001&&a+b-c<0.0001) printf("Yes\n"); else printf("No\n"); } return 0;}做这道题时我先是把if里的判断语句写成了a+b==c;结果想必您也应 阅读全文
posted @ 2013-07-26 16:51 王莜轩 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 今天下午我又做了一道有意思的题目与大家分享一下,此题是南阳OJ77开灯问题,代码如下:#includeint main(){ int i,j,n,k; scanf("%d %d",&n,&k); for(i=1;i<=n;i++) { int p=0; for(j=1;j<=k;j++) { if(i%j==0) p=!p; } if(p) printf("%d ",i); } printf("\n"); return 0;}先开始我真的感觉这道题好难,后来我看了讨论区的讨论结果,我彻底顿悟了,开灯问题的关 阅读全文
posted @ 2013-07-26 16:25 王莜轩 阅读(907) 评论(0) 推荐(0) 编辑
摘要: 2013年7月26日 阅读全文
posted @ 2013-07-26 15:23 王莜轩 阅读(515) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8