并查集
- Passerby ゛
这个作者很懒,什么都没留下…
展开
-
HDU1856 H - More is better(并查集)
Description 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 sele...原创 2018-11-18 21:28:59 · 134 阅读 · 0 评论 -
HDU 3635 Dragon Balls(并查集)
Five hundred years later, the number of dragon balls will increase unexpectedly, so it’s too difficult for Monkey King(WuKong) to gather all of the dragon balls together. His country has N cities and ...原创 2018-11-20 23:28:01 · 116 阅读 · 0 评论 -
codeforces 1108 F. MST Unification(最小生成树)
题意:给你一个图,问至少给其中某些边加多少使其成为一个路径总长度不变的唯一的最小生成树。 题目: http://codeforces.com/group/w1oiqifZbS/contest/1108/problem/F 思路:首先要明白冲突边(需要加长度的边)有什么条件 1.长度相等 2.连通的块相同 满足这两个条件就是冲突边,比赛的时候一直在思考怎么记录连通块相同然后做判断呢?发现很难实现,做...原创 2019-01-25 23:29:41 · 393 阅读 · 0 评论