
算法之并查集
cc_wood
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
How Many Tables HDU - 1213
题目链接:点我 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 know each o原创 2017-08-04 20:14:27 · 229 阅读 · 0 评论 -
小希的迷宫 HDU - 1272
题目链接:点我 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让原创 2017-08-04 20:18:05 · 234 阅读 · 0 评论 -
A Bug's Life HDU - 1829
题目链接:点我 BackgroundProfessor 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 opposit原创 2017-08-04 20:35:34 · 363 阅读 · 0 评论 -
More is better HDU - 1856
题目链接:点我 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 Wang selected a并查集原创 2017-08-04 20:41:54 · 404 阅读 · 1 评论 -
The Suspects POJ - 1611
题目链接:点我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 strategy i原创 2017-08-04 20:47:23 · 252 阅读 · 0 评论 -
食物链 POJ - 1182(并查集)
题目链接:点我动物王国中有三类动物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句原创 2017-08-05 08:12:26 · 305 阅读 · 0 评论 -
Parity game POJ - 1733(带权并查集 + 离散化)
题目链接:点我Now 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原创 2017-08-05 08:27:56 · 351 阅读 · 0 评论