
最小生成树
文章平均质量分 77
GKHack
这个作者很懒,什么都没留下…
展开
-
POJ1751 Highways(kru)
HighwaysTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11163 Accepted: 3174 Special JudgeDescriptionThe island nation of Flatopia is perfectly fl原创 2015-08-18 10:29:16 · 962 阅读 · 0 评论 -
HDOJ1233 还是畅通工程(kru)
Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 当原创 2015-08-10 10:01:04 · 923 阅读 · 0 评论 -
POJ1679 The Unique MST(kru)
DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of原创 2015-08-10 10:17:38 · 1009 阅读 · 0 评论 -
POJ1789 Truck History(kru, prim)
DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing ea原创 2015-08-10 09:50:31 · 1131 阅读 · 0 评论 -
Openjudge1487 Highways(prim)
总时间限制: 1000ms 内存限制: 65536kB描述The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is原创 2015-08-06 16:29:58 · 1019 阅读 · 0 评论 -
POJ1251 Jungle Roads(kru)
题目链接:点击打开链接给出n - 1组边长, 构成一张图, 要求删除一些边使得边长和最小且任意两点可到达.最小生成树, 套一个kru模板即可. 并查集初始化, 读入数据后对边长进行排序, 若并查集确定两点不在同一连通分量则将两点连接并存储所得到的边.AC代码:#include "iostream"#include "cstdio"#include "cstring"原创 2015-11-17 09:04:25 · 1028 阅读 · 0 评论 -
Codeforces Round #335 (Div. 2) 606D Lazy Student(最小生成树+stl)
D. Lazy Studenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputStudent Vladislav came to his programming e原创 2016-01-23 17:21:09 · 821 阅读 · 0 评论