上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 23 下一页
摘要: http://poj.org/problem?id=1679The Unique MSTTime Limit:1000MSMemory Limit:10000KTotal Submissions:17726Accepted:6150DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning t 阅读全文
posted @ 2013-08-08 16:57 crazy_apple 阅读(390) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1659Frogs' NeighborhoodTime Limit:5000MSMemory Limit:10000KTotal Submissions:6050Accepted:2623Special JudgeDescription未名湖附近共有N个大小湖泊L1,L2, ...,Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤i≤N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1,x2, ...,xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T 阅读全文
posted @ 2013-08-07 18:26 crazy_apple 阅读(233) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3249Test for JobTime Limit:5000MSMemory Limit:65536KTotal Submissions:8206Accepted:1831DescriptionMr.Dog was fired by his company. In order to support his family, he must find a new job as soon as possible. Nowadays, It's hard to have a job, since there are swelling num 阅读全文
posted @ 2013-08-07 16:26 crazy_apple 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 5 #define N 10000 6 using namespace std; 7 8 void Merge(int *b,int *a,int i,int m,int n) 9 {10 int s = i;11 int j,k;12 //归并13 for(j=m+1,k=i;i>1;33 MergeSort(b,a,s,mid); 34 MergeSort(b,a,mid+1,t);35 Merge(b,a,s,mid,t); //... 阅读全文
posted @ 2013-08-06 22:33 crazy_apple 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 随机函数生成一个超大数组:【code】: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 int main()10 {11 freopen("random.txt","w",stdout);12 int n;13 scanf("%d",&n);14 int i;15 srand(time(NULL));16 printf("%d\n",n);17 for(i=0;i 2 #include 阅读全文
posted @ 2013-08-06 19:04 crazy_apple 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 int partition(int *a,int left,int right) 8 { 9 a[0] = a[left]; //设置a[left]为主键值,存于a[0],即以a[left]值将[left,right]区间一分为二10 while(left=a[0]) right--; //从右边开始找到比主键值a[0]小的值,移到左边13 a[left]=a[right];14 while(left<right&... 阅读全文
posted @ 2013-08-06 17:31 crazy_apple 阅读(2176) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3277City HorizonTime Limit:2000MSMemory Limit:65536KTotal Submissions:15255Accepted:4111DescriptionFarmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildi 阅读全文
posted @ 2013-08-06 13:15 crazy_apple 阅读(454) 评论(0) 推荐(0) 编辑
摘要: http://acm.fzu.edu.cn/problem.php?pid=2105Problem DescriptionGiven N integers A={A[0],A[1],...,A[N-1]}. Here we have some operations:Operation 1: AND opn L RHere opn, L and R are integers.For L≤i≤R, we do A[i]=A[i] AND opn (here "AND" is bitwise operation).Operation 2: OR opn L RHere opn, 阅读全文
posted @ 2013-08-05 21:57 crazy_apple 阅读(863) 评论(0) 推荐(1) 编辑
摘要: http://poj.org/problem?id=3468A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:46488Accepted:13633Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to 阅读全文
posted @ 2013-08-04 22:33 crazy_apple 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目地址:http://poj.org/problem?id=2777Count ColorTime Limit:1000MSMemory Limit:65536KTotal Submissions:30995Accepted:9285DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board wit 阅读全文
posted @ 2013-08-04 16:49 crazy_apple 阅读(253) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 23 下一页