文章分类 -  简单题

摘要:SORT AGAINTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3428Accepted Submission(s): 1088Problem Description给你N个整数,x1,x2...xn,任取两个整数组合得到|xi-xj|,(014 #include15 int ans[2005];16 int a[1005];17 int Sub(int a,int b)18 {19 if(a>b) return a-b;20 ... 阅读全文
posted @ 2013-10-24 22:32 heaventouch 阅读(248) 评论(0) 推荐(0) 编辑
摘要:Ignatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 13455Accepted Submission(s): 5435Problem Description"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an 阅读全文
posted @ 2013-10-23 17:29 heaventouch 阅读(138) 评论(0) 推荐(0) 编辑
摘要:HintFor the fourth test case, (A,B) can be (0,5), (0,-5), (5,0), (-5,0), (3,4), (3,-4), (-3,4), (-3,-4), (4,3) , (4,-3), (-4,3), (-4,-3) Source 2011 Multi-University Training Contest 1 - Host by HNU Recommendxubiao 1 //31MS 280K 439 B C++ 2 //简单题..O(lgn) 3 #include 4 #include 5 int Pow(i... 阅读全文
posted @ 2013-10-03 10:39 heaventouch 阅读(144) 评论(0) 推荐(0) 编辑
摘要://15MS 248K 601 B C++ //读不懂题意是硬伤啊...//以输入的中间那个点为中点分成四个象限,再统计 #includestruct node{ int x,y;}v[200005];int main(void){ int x,y,n; while(scanf("%d",&n),n) { for(int i=0;i0&&v[i].y>0 || v[i].x<0&&v[i].y<0) cntx++; else cnty++; } prin... 阅读全文
posted @ 2013-09-14 09:53 heaventouch 阅读(113) 评论(0) 推荐(0) 编辑
摘要://求数根#includeint fun(int a);int main(){ int a; char c; while(1) { scanf("%c",&c); if(c=='0') break; a=c-'0'; while(scanf("%c",&c)!=EOF) { if(c=='\n') ... 阅读全文
posted @ 2013-09-11 19:49 heaventouch 阅读(135) 评论(0) 推荐(0) 编辑
摘要://简单题..#includeusing namespace std;double fun(int i);int main(){ int i,n; double e; printf("n e\n"); printf("- -----------\n"); printf("0 1\n"); printf("1 2\n"); printf("2 2.5\n"); e=2.5; for(i=3;i<=9;i++) { e+=1.0/fun(i); pr... 阅读全文
posted @ 2013-09-11 19:47 heaventouch 阅读(67) 评论(0) 推荐(0) 编辑
摘要://打表找规律#includeint main(void){ int arr[1000]={0,1,1}; int i,a,b,n; while(scanf("%d%d%d",&a,&b,&n),a||b||n) { for(i=3;i<1000;i++) { arr[i]=(a*arr[i-1]+b*arr[i-2])%7; if(arr[i]==1&&arr[i-1]==1) break; } n=n%(i-2); arr[0]=arr[i-2]; printf("%d\n",arr[n]); } ret 阅读全文
posted @ 2013-09-11 19:31 heaventouch 阅读(71) 评论(0) 推荐(0) 编辑
摘要:#includeint main(void){ int n; while(scanf("%d",&n)!=EOF) if(n%2) printf("%d\n\n",(n+1)/2*n); else printf("%d\n\n",n/2*(n+1)); return 0;} 阅读全文
posted @ 2013-09-11 19:10 heaventouch 阅读(94) 评论(0) 推荐(0) 编辑
摘要:1 //第一题解题报告 2 3 //入门题 4 5 #include 6 int main(void) 7 { 8 int a,b; 9 while(scanf("%d%d",&a,&b)!=EOF)10 printf("%d\n",a+b);11 return 0; 12 } 阅读全文
posted @ 2013-05-25 07:10 heaventouch 阅读(99) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示