随笔分类 -  并查集

1 2 下一页

POJ 1417 True Liars(并查集+DP)
摘要:True LiarsTime Limit:1000MSMemory Limit:10000KTotal Submissions:1556Accepted:457DescriptionAfter having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember a legend 阅读全文

posted @ 2013-04-06 15:49 kuangbin 阅读(3202) 评论(1) 推荐(1)

POJ 2912 Rochambeau(枚举+并查集)
摘要:RochambeauTime Limit:5000MSMemory Limit:65536KTotal Submissions:1575Accepted:540DescriptionNchildren are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty). You don’t know who is 阅读全文

posted @ 2013-04-05 22:21 kuangbin 阅读(1861) 评论(0) 推荐(1)

ZOJ 3261 Connections in Galaxy War (并查集)
摘要:Connections in Galaxy WarTime Limit:3 Seconds Memory Limit:32768 KBIn order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages. However, when the Galaxy War began, some tunnels were destroyed by the monsters from another 阅读全文

posted @ 2013-04-05 19:52 kuangbin 阅读(1660) 评论(2) 推荐(1)

HDU 3038 How Many Answers Are Wrong (并查集)
摘要:How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1372Accepted Submission(s): 553Problem DescriptionTT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the follo 阅读全文

posted @ 2013-04-05 18:59 kuangbin 阅读(4132) 评论(0) 推荐(0)

POJ 1733 Parity game (HASH+并查集)
摘要:Parity gameTime Limit:1000MSMemory Limit:65536KTotal Submissions:5168Accepted:2028DescriptionNow and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example the subsequence from the third to 阅读全文

posted @ 2013-04-05 13:53 kuangbin 阅读(1346) 评论(0) 推荐(1)

POJ 1456 Supermarket (贪心+并查集)
摘要:SupermarketTime Limit:2000MSMemory Limit:65536KTotal Submissions:7501Accepted:3148DescriptionA supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale beg 阅读全文

posted @ 2013-04-05 10:44 kuangbin 阅读(3212) 评论(0) 推荐(3)

POJ 2524 Ubiquitous Religions (最简单的并查集)
摘要:Ubiquitous ReligionsTime Limit:5000MSMemory Limit:65536KTotal Submissions:19259Accepted:9460DescriptionThere are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university b 阅读全文

posted @ 2013-04-05 10:09 kuangbin 阅读(607) 评论(0) 推荐(0)

POJ 2492 A Bug's Life (并查集)
摘要:A Bug's LifeTime Limit:10000MSMemory Limit:65536KTotal Submissions:23380Accepted:7603DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender 阅读全文

posted @ 2013-04-05 10:01 kuangbin 阅读(750) 评论(0) 推荐(0)

POJ 2236 Wireless Network (并查集)
摘要:Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:13323Accepted:5638DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n 阅读全文

posted @ 2013-04-05 09:47 kuangbin 阅读(637) 评论(0) 推荐(1)

POJ 1988 Cube Stacking(并查集)
摘要:Cube StackingTime Limit:2000MSMemory Limit:30000KTotal Submissions:15900Accepted:5419Case Time Limit:1000MSDescriptionFarmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks 阅读全文

posted @ 2013-04-05 09:25 kuangbin 阅读(708) 评论(0) 推荐(0)

POJ 1984 Navigation Nightmare (并查集)
摘要:Navigation NightmareTime Limit:2000MSMemory Limit:30000KTotal Submissions:3167Accepted:1317Case Time Limit:1000MSDescriptionFarmer John's pastoral neighborhood has N farms (2 <= N <= 40,000), usually numbered/labeled 1..N. A series of M (1 <= M < 40,000) vertical and horizontal roads 阅读全文

posted @ 2013-04-05 09:08 kuangbin 阅读(1125) 评论(0) 推荐(0)

POJ 1703 Find them, Catch them (并查集)
摘要:Find them, Catch themTime Limit:1000MSMemory Limit:10000KTotal Submissions:23816Accepted:7130DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify whi 阅读全文

posted @ 2013-04-02 22:41 kuangbin 阅读(480) 评论(0) 推荐(0)

POJ 1611 The Suspects (并查集,简单)
摘要:The SuspectsTime Limit:1000MSMemory Limit:20000KTotal Submissions:17128Accepted:8254DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separa 阅读全文

posted @ 2013-04-02 20:36 kuangbin 阅读(627) 评论(0) 推荐(0)

HDU 1325 Is It A Tree? POJ 1308 Is It A Tree? (并查集+入度,判断一个有向图是树)
摘要:Is It A Tree?Time Limit:1000MSMemory Limit:10000KTotal Submissions:17328Accepted:5934DescriptionA tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.There is exa 阅读全文

posted @ 2013-04-02 20:09 kuangbin 阅读(717) 评论(0) 推荐(0)

POJ 1182 食物链(并查集)
摘要:食物链Time Limit:1000MSMemory Limit:10000KTotal Submissions:33631Accepted:9770Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种说法是"1 X Y",表示X和Y是同类。第二种说法是"2 X Y",表示X吃Y。此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句 阅读全文

posted @ 2013-04-02 20:06 kuangbin 阅读(2551) 评论(0) 推荐(0)

ZOJ 3659 Conquer a New Region 第37届ACM/ICPC 长春赛区现场赛E题 (并查集)
摘要:Conquer a New RegionTime Limit: 5 Seconds Memory Limit: 32768 KBThe wheel of the history rolling forward, our king conquered a new region in a distant continent.There are N towns (numbered from 1 to N) in this region connected by several roads. It's confirmed that there is exact one route betwee 阅读全文

posted @ 2012-10-17 08:54 kuangbin 阅读(1337) 评论(0) 推荐(0)

HDU 3635 Dragon Balls(并查集)
摘要:Dragon BallsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1201Accepted Submission(s): 484Problem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gath 阅读全文

posted @ 2012-08-30 21:04 kuangbin 阅读(2956) 评论(1) 推荐(2)

POJ 2513 Colored Sticks(欧拉回路,字典树,并查集)
摘要:Colored SticksTime Limit: 5000MSMemory Limit: 128000KTotal Submissions: 24748Accepted: 6519DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoints that touch 阅读全文

posted @ 2012-08-07 10:18 kuangbin 阅读(2439) 评论(2) 推荐(0)

HDU 1272 小希的迷宫(并查集)
摘要:小希的迷宫Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13438Accepted Submission(s): 4059Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提 阅读全文

posted @ 2012-07-29 08:29 kuangbin 阅读(2033) 评论(0) 推荐(0)

HDU 1232 畅通工程(并查集)
摘要:畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16505Accepted Submission(s): 8515Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给 阅读全文

posted @ 2012-07-29 07:43 kuangbin 阅读(5930) 评论(0) 推荐(1)

1 2 下一页

导航

JAVASCRIPT: