
最小生成树
文章平均质量分 79
ToRe.
这个作者很懒,什么都没留下…
展开
-
UVA 11354 Bond(Kruskal+并查集启发式合并)
题目链接 题意 给一张无向图,多次查询两点,求两点之间最小瓶颈路的权值。 思路 最小生成树+LCA是一种,下面讲另种方法通过限制树的高度暴力LCA求解。 首先可以用Kruskal求最小生成树,那么任意两连通的点最小瓶颈路都会在生成树上。 在Kruskal算法中的并查集我们不能使用路径压缩,会破坏树的结构。比如两点间 a=>b,变成了a=> c <=b,那么答案就可能出错。 可以按...原创 2019-07-16 16:06:08 · 136 阅读 · 0 评论 -
POJ 3723 Conscription(最大生成树 Kruskal)
Description Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his soldiers. To collect a soldier without原创 2018-04-07 20:10:35 · 154 阅读 · 0 评论 -
POJ 3026 Borg Maze(BFS + 最小生成树)
DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civi...原创 2018-03-19 17:33:06 · 223 阅读 · 0 评论 -
POJ 2349 Arctic Network(最小生成树 Prim)
DescriptionThe Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the netwo...原创 2018-03-16 13:20:21 · 217 阅读 · 0 评论