并查集
文章平均质量分 81
Lionel_D
这个作者很懒,什么都没留下…
展开
-
poj 1703 Find them, Catch them 带权并查集OR种类并查集
The 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 which gang a criminal belongs to. The present question is, give原创 2015-02-01 12:13:14 · 745 阅读 · 0 评论 -
hdoj 1272 小希的迷宫
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的设计图是否符合她的设计思路。比如下面的例子,前两个是符合条件的,但是最后一个却有两种方法从5到达8。原创 2015-01-31 19:32:45 · 951 阅读 · 0 评论 -
poj 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 in your university believe in. You know that there are n students in your uni原创 2015-01-31 18:22:24 · 836 阅读 · 0 评论 -
poj1182 食物链 带权值的并查集
动物王国中有三类动物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。原创 2015-02-01 18:11:39 · 861 阅读 · 0 评论 -
hdu 1811 Rank of Tetris 并查集+拓扑排序,,提高题
Rank of TetrisTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5672 Accepted Submission(s): 1616Problem Description自从Lele开发了Rating原创 2015-02-20 16:39:27 · 929 阅读 · 0 评论 -
hdu 3172 Virtual Friends 并查集的应用,输入有坑!!!!
Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' friends, their friends' friends' friends,原创 2015-03-06 19:38:45 · 877 阅读 · 0 评论 -
hdu 1598 find the most comfortable road 一开始把此题当做最短路。。后来发现不行。。并查集+枚举
Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。原创 2015-03-29 11:07:05 · 1047 阅读 · 0 评论 -
hdu 3018 Ant Trip 算是一道欧拉通路的题目吧~
Problem DescriptionAnt Country consist of N towns.There are M roads connecting the towns.Ant Tony,together with his friends,wants to go through every part of the country. They intend to visit every road , and every road must be visited for exact one t原创 2015-04-27 11:17:04 · 932 阅读 · 0 评论 -
hdu 3367 Pseudoforest 伪森林 题目很难懂,模仿kruskal,并查集检查两个节点是否是一个环
PseudoforestTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2880 Accepted Submission(s): 1129Problem DescriptionIn graph theory,原创 2017-03-12 23:44:00 · 915 阅读 · 0 评论