![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
生成树
yankunhaha
这个作者很懒,什么都没留下…
展开
-
hdu1102 Constructing Roads 最小生成树+prim
Problem Description There are Nvillages, which are numbered from 1 to N, and you should build some roads suchthat every two villages can connect to each other. We say two village A and Bare connected原创 2012-11-13 21:44:50 · 556 阅读 · 0 评论 -
次小生成树 附 poj1679The Unique MST
次小生成树,可通过最小生成树求得。最小生成树得到后,把某一未利用的边加入树中,则会形成一个环,把这个环上其余的最大边去掉,就会得到这个加入这个边的次小生成树。把所有的未利用的边遍历,取最小值,就会得到次小生成树。 附poj1679的代码: #include #include #include using namespace std; const int maxn=105;原创 2012-11-14 16:04:38 · 279 阅读 · 0 评论