并查集
mumei314
这个作者很懒,什么都没留下…
展开
-
hdu3038——带权并查集区间判错
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3038TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. Th...原创 2019-08-18 17:37:44 · 203 阅读 · 0 评论 -
poj1611——并查集基础题
题目链接:http://poj.org/problem?id=1611Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission...原创 2019-08-18 12:21:46 · 183 阅读 · 0 评论 -
poj2236——并查集变形
题目链接:http://poj.org/problem?id=2236An 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 afters...原创 2019-08-18 12:16:36 · 192 阅读 · 0 评论 -
kuangbin带你飞并查集专题总结
最近花了一段时间做了kuangbin带你飞并查集专题,今天来做个总结!!!并查集本来以为很简单的,做了专题才发现,以前的自己真天真。并查集,顾名思义:用来快速实现合并,查询集合的操作(缺点:对于把元素提出集合的操作实现不了)关于最简单的并查集操作和过程,这里也不多说了,大家可以看啊哈算法里面的讲解,既生动又形象。这里强推几个好的讲解:【坐在马桶上看算法】啊哈算法13:零基础彻底...原创 2019-08-19 01:14:17 · 366 阅读 · 0 评论 -
poj1733——(好题)并查集+离散化(hash)
题目链接:http://poj.org/problem?id=1733Now 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 (f...原创 2019-08-19 00:19:43 · 555 阅读 · 0 评论 -
poj1456——(妙用并查集)暴力贪心
题目链接:http://poj.org/problem?id=1456A 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...原创 2019-08-18 22:21:54 · 238 阅读 · 0 评论 -
zoj3261——(好题)并查集+离线(逆向)处理
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3261n order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange...原创 2019-08-18 22:11:50 · 737 阅读 · 2 评论 -
hdu1272——(经典)判断无向图是不是一棵树
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,...原创 2019-08-18 22:03:54 · 1543 阅读 · 0 评论 -
poj1308——(经典)判断有向图是不是一棵树
题目链接:http://poj.org/problem?id=1308A 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 satisfy...原创 2019-08-18 21:52:14 · 3433 阅读 · 1 评论 -
poj1182——种类并查集
题目链接:poj.org/problem?id=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。此人...原创 2019-08-18 18:10:51 · 156 阅读 · 0 评论 -
poj2492——种类并查集
题目链接:http://poj.org/problem?id=2492BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only int...原创 2019-08-18 18:02:11 · 147 阅读 · 0 评论 -
hdu1213——并查集基础题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1213Today 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 ...原创 2019-08-18 12:32:14 · 233 阅读 · 0 评论