![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
生成树
浮生一朝
这个作者很懒,什么都没留下…
展开
-
The Unique MST POJ - 1679(最小生成树)
Given 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 G is a subgraph o原创 2018-01-31 09:03:36 · 281 阅读 · 0 评论 -
Jungle Roads HDU - 1301 (最小生成树 prim)
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so原创 2018-01-31 09:33:18 · 187 阅读 · 0 评论 -
Borg Maze POJ - 3026(最小生成树prim,bfs)
The 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 civilization. E原创 2018-01-31 11:34:41 · 218 阅读 · 0 评论 -
ACM Contest and Blackout UVA - 10600 (次小生成树)
题目连接 Sample Input 2 5 8 1 3 75 3 4 51 2 4 19 3 2 95 2 5 42 5 4 31 1 2 9 3 5 66 9 14 1 2 4 1 8 8 2 8 11 3 2 8 8 9 7 8 7 1 7 9 6 9 3 2 3 4 7 3 6 4 7 6 2 4 6 14 4 5 9 5 6 10 Sa原创 2018-02-01 15:20:25 · 244 阅读 · 0 评论 -
Is There A Second Way Left? UVA - 10462(次小生成树,Kruskal)
题意:求连通图的最小和次小长度,三种情况:1.不存在最小 2.不存在次小 3.最小和次小不同。 无法使用prim求次小生成树,因为可能有两个点有两个及以上权值(有重边),那么我们用prim会把大的权值覆盖掉,所以我们用kruskal求,我们求出最小生成树后,把用过的边绕过,求最小生成树,如果存在则存在 #include #include #include #include using name原创 2018-02-01 21:36:30 · 254 阅读 · 0 评论 -
Command Network POJ - 3164(根为1的最小树形图)
After a long lasting war on words, a war on arms finally breaks out between littleken’s and KnuthOcean’s kingdoms. A sudden and violent assault by KnuthOcean’s force has rendered a total failure of li原创 2018-02-03 09:23:07 · 227 阅读 · 0 评论