并查集
Nothing_227
Nothing is impossible!
展开
-
并查集——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 other, a...原创 2019-04-01 16:22:12 · 173 阅读 · 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 room ...原创 2019-04-01 16:52:11 · 162 阅读 · 0 评论 -
并查集——Wireless Network (POJ - 2236)
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 computers in the n...原创 2019-04-01 19:47:03 · 159 阅读 · 0 评论 -
并查集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 is to s...原创 2019-04-01 20:29:32 · 154 阅读 · 0 评论 -
带权并查集- Building Block (HDU - 2818)
John are playing with blocks. There are N blocks (1 <= N <= 30000) numbered 1...N。Initially, there are N piles, and each pile contains one block. Then John do some operations P times (1 <= P ...原创 2019-04-02 11:24:56 · 194 阅读 · 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句话,这K句话...原创 2019-04-02 12:29:52 · 215 阅读 · 0 评论 -
并查集基础题(小希的迷宫 HDU1272)
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的...原创 2019-03-29 09:27:56 · 232 阅读 · 0 评论