专题八 生成树
九羽-
日有所进,月有所变,终有所成。
展开
-
The Unique MST ( 次小生成树 + kruskal模板 )
The Unique MST ( 次小生成树 + kruskal模板 )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...原创 2019-08-13 16:44:49 · 242 阅读 · 0 评论 -
Qin Shi Huang's National Road System( 次小生成树 )
Qin Shi Huang's National Road System( 次小生成树 )During the Warring States Period of ancient China(476 BC to 221 BC), there were seven kingdoms in China ---- they were Qi, Chu, Yan, Han, Zhao, Wei and...原创 2019-08-15 09:53:01 · 139 阅读 · 0 评论 -
ACM Contest and Blackout (次小生成树)
ACM Contest and Blackout (次小生成树)Sample Input 25 81 3 753 4 512 4 193 2 952 5 425 4 311 2 93 5 669 141 2 41 8 82 8 113 2 88 9 78 7 17 9 69 3 23 4 73 6 47 6 24 6 144 5 95 ...原创 2019-08-15 10:16:39 · 194 阅读 · 0 评论 -
Is There A Second Way Left? (次小生成树)
Is There A Second Way Left? (次小生成树)题意:村子里要连接电缆,想要最少的花费连接所有家庭,求方案的最少花费;但村长还想要第二种方案,就是花费第二少的方案。思路:求最小生成树和次小生成树。代码:#include <bits/stdc++.h>using namespace std;const int maxn ...原创 2019-08-15 10:34:08 · 224 阅读 · 0 评论