上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: /*六度分离Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2661 Accepted Submission(s): 1035Problem Description1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six . 阅读全文
posted @ 2013-07-09 21:19 myth_HG 阅读(730) 评论(0) 推荐(0) 编辑
摘要: /*PROBLEMSSUBMITSTATUSSTANDINGSCUSTOM TESTB. T-primestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWe know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we'll call a positive integer t 阅读全文
posted @ 2013-07-09 18:49 myth_HG 阅读(863) 评论(0) 推荐(0) 编辑
摘要: Prime CutsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9339Accepted:3562DescriptionA prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of prime numbers from the list of prime n 阅读全文
posted @ 2013-07-09 16:18 myth_HG 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Prime GapTime Limit:5000MSMemory Limit:65536KTotal Submissions:7392Accepted:4291DescriptionThe sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numberspandp+nis called a prime gap of lengthn. For example, ‹24 阅读全文
posted @ 2013-07-09 14:25 myth_HG 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Cube StackingTime Limit:2000MSMemory Limit:30000KTotal Submissions:16258Accepted:5579Case Time Limit:1000MSDescriptionFarmer John and Betsy are playing a game with N (1 #includeusing namespace std;#define maxn 30003int num[maxn];int dis[maxn]={0};int father[maxn];int find_set(int x){ if(x!=father[x] 阅读全文
posted @ 2013-07-08 19:48 myth_HG 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include #includeusing namespace std;int main(){ int r,n,ans,t; scanf("%d%d",&n,&r); if(n-r<r) r=n-r; ans = n; n=n-1; t=2; while(t<=r) { ans=ans*n/t; n--; t++; } printf("%d\n",ans); return 0;} 阅读全文
posted @ 2013-07-08 10:09 myth_HG 阅读(112) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <iostream>#include<algorithm>#include<windows.h>#include<math.h>using namespace std;#define Max 20#define LT(a,b) ((a)<(b))void setcolor(int color){ HANDLE hout=GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hout,color);}typedef s 阅读全文
posted @ 2013-01-17 16:50 myth_HG 阅读(530) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<afx.h> #include<time.h>#include<string>#include <windows.h>int main(){ CTime t = CTime::GetCurrentTime(); //获取系统日期,存储在t里面 int d=t.GetDay();int y=t.GetYear();int m=t.GetMonth();int h=t.GetHour();int mm=t.GetMinute();int s=t.GetSecond();int w=t.G 阅读全文
posted @ 2012-12-14 13:59 myth_HG 阅读(256) 评论(0) 推荐(0) 编辑
摘要: /*杭电2011和2012级同学如何加入ACM集训队?微软招聘信息(主要针对已经有工作经验的) 统计硬币Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2497 Accepted Submission(s): 1727Problem Description假设一堆由1分、2分、5分组成的n个硬币总面值为m分,求一共有多少种可能的组合方式(某种面值的硬币可以数量可以为0)。 Input输入数据第一行有一个正整数T,表示有T组测试数... 阅读全文
posted @ 2012-11-25 15:25 myth_HG 阅读(542) 评论(0) 推荐(0) 编辑
摘要: /*放大的XTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5732 Accepted Submission(s): 1747Problem Description请你编程画一个放大的’X’。如3*3的’X’应如下所示:X X XX X5*5的’X’如下所示:X X X X X X XX X Input输入数据第一行是一个整数T,表示有T组测试数据;接下来有T行,每行有一个正奇数n(3 <= n <= 79),表示放大的... 阅读全文
posted @ 2012-11-24 23:54 myth_HG 阅读(680) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页