摘要:http://codeforces.com/contest/252A.数据小直接暴力。B.当时理解错了。c.二逼了。。。j不应该每次从0开始,否则会超时。比如4 31 2 3 41到4不超过32到4就更不会超。View Code 1 #include<stdio.h> 2 int main() 3 { 4 __int64 n; 5 __int64 d,i,j; 6 __int64 a[100010]; 7 while(~scanf("%I64d%I64d",&n,&d)) 8 { 9 for(i=0;i<n;i++)10 ...
阅读全文
摘要:C. Beauty Pageanttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGeneral Payne has a battalion of n soldiers. The soldiers' beauty contest is coming up, it will last for k days. Payne decided that his battalion will participate in the pageant
阅读全文
摘要:B. Chilly Willytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputChilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up w
阅读全文
摘要:E. Mishap in Clubtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus just has been out of luck lately! As soon as he found a job in the "Binary Cat" cafe, the club got burgled. All ice-cream was stolen.On the burglary night Polyc
阅读全文
摘要:坑。http://codeforces.com/contest/245/problem/BB. Internet Addresstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We kn
阅读全文
摘要:A. Old Peykantime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities in the country where the Old Peykan lives. These cities are located on a straight line, we'll denote them from left to right as c1, c2, ..., cn. The Old Peykan wa
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4452英语弱成渣,没看懂题目之前,样例没看明白。。trun around没注意。还有交换方向的时候理解错一句话,应该是题目写错了。模拟就是View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 int n,t1,s1,t2,s2,k; 7 char ch1,ch2; 8 char temp1,temp2; 9 int x1,y1,x2,y2; 10 int ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4451View Code 1 #include <stdio.h> 2 #include<string.h> 3 #include <stdlib.h> 4 int main() 5 { 6 int n,m,k,n1,m1,k1; 7 int in[1010]; 8 int to[1010]; 9 int c,i,num1,num2;10 char str1[20],str2[20];11 while(~scanf("%d%d%d",&n,&am
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4450巨水题,不解释View Code 1 #include<stdio.h> 2 int main() 3 { 4 int n; 5 int c; 6 int i; 7 while(~scanf("%d",&n),n) 8 { 9 int sum=0;10 for(i=0;i<n;i++)11 {12 scanf("%d",&c);13 sum+=c*c;14 ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4442比赛时做得很差,考虑时没考虑清楚,也正因为这样,才拖了很久,,最后一分钟提交,拿了个顽强拼搏奖,哈哈哈。。贪心:设已经排好一些,花时间t,然后考虑两情况哪种好(node[i].a,node[i].b),node[j].a,node[j].b),必有t+node[i].a+node[i].b*t+node[j].a+node[j].b(t+node[i].a+node[i].b*t)<=t+node[j].a+node[j].b*t+node[i].a+node[i].b(t+node[j].a+n
阅读全文