并查集
文章平均质量分 80
「已注销」
这个作者很懒,什么都没留下…
展开
-
CodeForces 445B DZY Loves Chemistry
DZY Loves Chemistry DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and m pairs of them will react. He wants to pour these chemicals into a test tube, and he needs to pour原创 2017-10-25 13:51:33 · 275 阅读 · 0 评论 -
HDU1272 小希的迷宫
小希的迷宫 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让原创 2017-10-25 14:11:45 · 156 阅读 · 0 评论 -
uva1160 X-Plosives
UVA 1160 X-Plosives 题意: 现在手上有一些化合物,每个化合物都不相同且由两个不同整数构成,当你手上存在这种情况时: 手上有至少N(N>2)个化合物且其中有N个化合物正好包含N个不同的整数(即这N个整数每个出现了2次)。那么此时化合物不稳定。比如你有化合物(1,2),(2,3),(3,1)那么就是不稳定的,但是你如果只有(1,2),(2原创 2017-10-26 19:28:42 · 670 阅读 · 0 评论 -
poj2524 Ubiquitous Religions
Ubiquitous Religions There 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 i原创 2017-10-26 19:28:00 · 648 阅读 · 0 评论 -
poj2236 Wireless Network
Wireless Network An 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原创 2017-10-25 14:22:21 · 188 阅读 · 0 评论 -
POJ1962、uva3027 Corporative Network
POJ1962:Corporative Network(并查集) Description A very big corporation is developing its corporative network. In the beginning each of the N enterprises of the corporation, numerated from 1 to N, org原创 2017-10-25 14:16:36 · 275 阅读 · 0 评论 -
poj1611 The Suspects
The Suspects Severe 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 st原创 2017-10-25 14:16:03 · 268 阅读 · 0 评论 -
HDU1856 More is better
More is better Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements. Mr原创 2017-10-25 14:14:24 · 143 阅读 · 0 评论 -
HDU1232 畅通工程
畅通工程 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,原创 2017-10-25 14:11:02 · 166 阅读 · 0 评论 -
HDU1213 How Many Tables
How Many Tables Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends k原创 2017-10-25 14:10:35 · 241 阅读 · 0 评论 -
poj1308、HDU1325 、Is It A Tree
Is It A Tree? A 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 prop原创 2017-10-25 14:15:05 · 316 阅读 · 0 评论