CF109 C. Lucky Tree 并查集
摘要:Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits4and7. ...
阅读全文
posted @
2015-10-14 17:58
_fukua
阅读(435)
推荐(0)
hdu 5441 travel 离线+带权并查集
摘要:Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem DescriptionJack likes to travel around the world, but he doe...
阅读全文
posted @
2015-09-14 14:28
_fukua
阅读(311)
推荐(0)
CF 500 B. New Year Permutation 并查集
摘要:User ainta has a permutationp1, p2, ..., pn. As the New Year is coming, he wants to make his permutation as pretty as possible.Permutationa1, a2, ...,...
阅读全文
posted @
2015-09-11 22:00
_fukua
阅读(245)
推荐(0)
POJ2236 Wireless Network 并查集 好题
摘要:Wireless NetworkDescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless networ...
阅读全文
posted @
2015-04-17 20:57
_fukua
阅读(386)
推荐(0)
POJ1182 食物链 并查集 好题
摘要:食物链Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。有人用两种说法对这N个动物所构成的食物链关系进行描述:第一种...
阅读全文
posted @
2015-04-17 00:08
_fukua
阅读(227)
推荐(0)
POJ1703 Find them, Catch them 并查集 好题 有坑点
摘要:DescriptionThe 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 Ga...
阅读全文
posted @
2015-04-15 23:26
_fukua
阅读(288)
推荐(0)
about_并查集
摘要:前天刚学了并查集,挺好用的,虽然我现在只会用它来解决是不是亲戚啊,是不是朋友啊,带权并查集还不是很理解。 并查集也叫做不相交集合,主要有3个操作,初始化,查找,合并。 并查集其中一个很大的应用就是kruskal嘛。 并查集就是说,有n个元素嘛,我们把每个元素初始化为一个集合...
阅读全文
posted @
2015-01-19 11:58
_fukua
阅读(208)
推荐(0)