随笔分类 -  连通图 LCA

摘要:Caocao's BridgesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 76Accepted Submission(s): 38Problem DescriptionCaocao was defeated by Zhuge Liang and Zhou Yu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not g 阅读全文
posted @ 2013-09-15 18:58 线性无关 阅读(137) 评论(0) 推荐(0)
摘要:The Cow PromTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1010Accepted: 633DescriptionThe N (2 =2的连通分量个数,大水题一发。代码:#include#include#include#include#include#includeusingnamespacestd;constintmaxn=50010;inthead[10*maxn],tol,indexx,top,scc,ans,low[maxn],dfn[maxn],belong[maxn],Stack[maxn],inst. 阅读全文
posted @ 2013-09-13 01:04 线性无关 阅读(135) 评论(0) 推荐(0)
摘要:King's QuestTime Limit: 15000MSMemory Limit: 65536KTotal Submissions: 6624Accepted: 2361Case Time Limit: 2000MSDescriptionOnce upon a time there lived a king and he had N sons. And there were N beautiful girls in the kingdom and the king knew about each of his sons which of those girls he did li 阅读全文
posted @ 2013-09-10 15:07 线性无关 阅读(127) 评论(0) 推荐(0)
摘要:Instantaneous TransferenceTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 5153Accepted: 1123DescriptionIt was long ago when we played the game Red Alert. There is a magic function for the game objects which is called instantaneous transfer. When an object uses this magic function, it will . 阅读全文
posted @ 2013-09-10 15:04 线性无关 阅读(121) 评论(0) 推荐(0)
摘要:考研路茫茫——空调教室Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1729Accepted Submission(s): 498Problem Description众所周知,HDU的考研教室是没有空调的,于是就苦了不少不去图书馆的考研仔们。Lele也是其中一个。而某教室旁边又摆着两个未装上的空调,更是引起人们无限YY。一个炎热的下午,Lele照例在教室睡觉的时候,竟然做起了空调教室的美梦。Lele梦到学校某天终于大发慈悲给某个教室安上了. 阅读全文
posted @ 2013-09-06 23:17 线性无关 阅读(171) 评论(0) 推荐(0)
摘要:Hawk-and-ChickenProblem DescriptionKids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk.So the teacher came up with an idea: Vote. Every child have some nice handkerchiefs, and if he/she think . 阅读全文
posted @ 2013-09-05 19:51 线性无关 阅读(156) 评论(0) 推荐(0)
摘要:CactusProblem Description1. It is a Strongly Connected graph.2. Each edge of the graph belongs to a circle and only belongs to one circle.We call this graph as CACTUS.There is an example as the figure above. The left one is a cactus, but the right one isn’t. Because the edge (0, 1) in the right gra. 阅读全文
posted @ 2013-09-05 16:09 线性无关 阅读(142) 评论(0) 推荐(0)
摘要:Father Christmas flymouseTime Limit: 1000MSMemory Limit: 131072KTotal Submissions: 2236Accepted: 754DescriptionAfter retirement as contestant from WHU ACM Team, flymouse volunteered to do the odds and ends such as cleaning out the computer lab for training as extension of his contribution to the t.. 阅读全文
posted @ 2013-09-03 19:03 线性无关 阅读(185) 评论(0) 推荐(0)
摘要:Going from u to v or from v to u?Time Limit: 2000MSMemory Limit: 65536KTotal Submissions: 12926Accepted: 3351DescriptionIn 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, Wind choose two rooms x .. 阅读全文
posted @ 2013-09-03 17:07 线性无关 阅读(149) 评论(0) 推荐(0)
摘要:The Bottom of a GraphTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 8019Accepted: 3313We will use the following (standard) definitions from graph theory. Let V be a nonempty and finite set, its elements being called vertices (or nodes). Let E be a subset of the Cartesian product V×V, 阅读全文
posted @ 2013-09-03 00:04 线性无关 阅读(155) 评论(0) 推荐(0)
摘要:The King’s ProblemProblem DescriptionIn the Kingdom of Silence, the king has a new problem. There are N cities in the kingdom and there are M directional roads between the cities. That means that if there is a road from u to v, you can only go from city u to city v, but can’t go from city v to city. 阅读全文
posted @ 2013-09-02 22:28 线性无关 阅读(127) 评论(0) 推荐(0)
摘要:ElectricityTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 3074Accepted: 1043DescriptionBlackouts and Dark Nights (also known as ACM++) is a company that provides electricity. The company owns several power plants, each of them supplying a small area that surrounds it. This organization b.. 阅读全文
posted @ 2013-09-02 11:40 线性无关 阅读(122) 评论(0) 推荐(0)
摘要:Redundant PathsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7654Accepted: 3339DescriptionIn order to get from one of the F (1 #include#include#include#includeusing namespace std;int maxn=1000170;int head[2000],low[2000],dfn[2000],Stack[2000],instack[2000],indexx,top,scc,belong[2000],tol. 阅读全文
posted @ 2013-09-02 11:08 线性无关 阅读(126) 评论(0) 推荐(0)
摘要:Network Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 548Accepted Submission(s): 105 Problem DescriptionA network administrator manages a large network. The network consists of N computers and M links between pairs of computers. Any pair of com 阅读全文
posted @ 2013-09-02 10:42 线性无关 阅读(132) 评论(0) 推荐(0)
摘要:Cow Ski AreaTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1888Accepted: 563DescriptionFarmer John's cousin, Farmer Ron, who lives in the mountains of Colorado, has recently taught his cows to ski. Unfortunately, his cows are somewhat timid and are afraid to ski among crowds of people 阅读全文
posted @ 2013-09-01 22:05 线性无关 阅读(152) 评论(0) 推荐(0)
摘要:Road ConstructionTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 7373Accepted: 3697DescriptionIt's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradise of Remote Island 阅读全文
posted @ 2013-09-01 17:09 线性无关 阅读(302) 评论(0) 推荐(0)
摘要:Countries in WarTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1961Accepted: 616DescriptionIn the year 2050, after different attempts of the UN to maintain peace in the world, the third world war broke out. The importance of industrial, commercial and military secrets obliges all the cou.. 阅读全文
posted @ 2013-09-01 15:30 线性无关 阅读(183) 评论(0) 推荐(0)
摘要:Network of SchoolsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9604Accepted: 3820DescriptionA 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 distributes software (the “receiv.. 阅读全文
posted @ 2013-09-01 09:09 线性无关 阅读(137) 评论(0) 推荐(0)
摘要:Popular CowsTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 20542Accepted: 8357DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 #include#include#includeusingnamespacestd;structEdge{intnext,to;}edge[1000000];inthead[10010],stack[10010],belong[ 阅读全文
posted @ 2013-09-01 08:45 线性无关 阅读(129) 评论(0) 推荐(0)
摘要:NetworkTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 7966Accepted: 3755DescriptionA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the same number. The lines are bidirec.. 阅读全文
posted @ 2013-09-01 08:11 线性无关 阅读(150) 评论(0) 推荐(0)