随笔分类 - ACM
摘要:http://poj.org/problem?id=2449Remmarguts' DateTime Limit:4000MSMemory Limit:65536KTotal Submissions:18168Accepted:4984Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story.&
阅读全文
摘要:http://poj.org/problem?id=3463SightseeingTime Limit:2000MSMemory Limit:65536KTotal Submissions:6420Accepted:2270DescriptionTour operator Your Personal Holiday organises guided bus trips across the Benelux. Every day the bus moves from one citySto another cityF. On this way, the tourists in the bus c
阅读全文
摘要:http://acm.sdibt.edu.cn/JudgeOnline/problem.php?id=3237Problem H:Boring CountingTime Limit: 3 Sec Memory Limit: 128 MB Submit: 8 Solved: 4 [Submit][Status][Discuss]DescriptionIn this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now you
阅读全文
摘要:2013年"浪潮杯"山东省第四届ACM大学生程序设计竞赛排名:http://acm.upc.edu.cn/ranklist/一、第J题坑爹大水题,模拟一下就行了J:Contest Print Server【题解】: 题目大意:输入n,s,x,y,mod 分别队伍数n,还有一个s生成函数 s=((s*x)+y)%mod,就是打印机根据要求打印纸张,打印到s时,打印机将重置,生成新的s【code】: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 int t; 9 ...
阅读全文
摘要:http://poj.org/problem?id=3522Slim SpanTime Limit:5000MSMemory Limit:65536KTotal Submissions:5666Accepted:2965DescriptionGiven an undirected weighted graphG, you should find one of spanning trees specified as follows.The graphGis an ordered pair (V,E), whereVis a set of vertices {v1,v2, …,vn} andEis
阅读全文
摘要:http://poj.org/problem?id=1236Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9481Accepted:3767DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distribut
阅读全文
摘要:http://poj.org/problem?id=2762Going from u to v or from v to u?Time Limit:2000MSMemory Limit:65536KTotal Submissions:12733Accepted:3286DescriptionIn order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time,
阅读全文
摘要:题目地址:http://poj.org/problem?id=2553The Bottom of a GraphTime Limit:3000MSMemory Limit:65536KTotal Submissions:7881Accepted:3263DescriptionWe will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subs
阅读全文
摘要:http://poj.org/problem?id=2186Popular CowsTime Limit:2000MSMemory Limit:65536KTotal Submissions:20191Accepted:8193DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 #define N 10010 14 using.
阅读全文
摘要:http://poj.org/problem?id=3013Big Christmas TreeTime Limit:3000MSMemory Limit:131072KTotal Submissions:19009Accepted:4048DescriptionChristmas is coming to KCM city. Suby the loyal civilian in KCM city is preparing a big neat Christmas tree. The simple structure of the tree is shown in right picture.
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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); //...
阅读全文
摘要:随机函数生成一个超大数组:【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
阅读全文
摘要: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&...
阅读全文
摘要: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
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文
摘要:题目地址: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
阅读全文

浙公网安备 33010602011771号