最小生成树
最小生成树
浪漫些许潦草
这个作者很懒,什么都没留下…
展开
-
MT2140 供水管线(最小生成树Kruskal)
思路:Kruskal模板题。原创 2024-07-28 12:38:59 · 220 阅读 · 0 评论 -
CSU 1116 Kingdoms(Kruskal)(枚举)
KingdomsDescription A kingdom has n cities numbered 1 to n, and some bidirectional roads connecting cities. The capital is always city 1. After a war, all the roads of the kingdom are destroyed. The原创 2017-05-10 16:58:05 · 482 阅读 · 0 评论 -
poj 3522 Slim Span(Kruskal+枚举)
Slim SpanDescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), where V is a set of vertices {v1, v2, …, vn}原创 2017-07-20 16:55:50 · 611 阅读 · 0 评论 -
FZU 2254 英语考试 (最小生成树)(福州大学第十四届程序设计竞赛)
英语考试Problem Description 在过三个礼拜,YellowStar有一场专业英语考试,因此它必须着手开始复习。这天,YellowStar准备了n个需要背的单词,每个单词的长度均为m。YellowSatr准备采用联想记忆法来背诵这n个单词:1、如果YellowStar凭空背下一个新词T,需要消耗单词长度m的精力2、如果YellowSatr之前已经背诵了一些单词,它可以选择其中一个单词原创 2017-07-15 08:35:09 · 1316 阅读 · 0 评论 -
2017ccpc全国邀请赛(湖南湘潭) H. Highway (最大生成树)(树的直径)
HighwayIn ICPCCamp there were n towns conveniently numbered with 1,2,…,n connected with (n−1) roads. The i-th road connecting towns ai and bi has length ci. It is guaranteed that any two cities reach e原创 2017-05-23 18:58:57 · 1289 阅读 · 0 评论 -
CodeForces - 76A Gift(最小生成树Kruskal)(思维)
GiftThe kingdom of Olympia consists of N cities and M bidirectional roads. Each road connects exactly two cities and two cities can be connected with more than one road. Also it possible tha原创 2017-03-14 13:37:37 · 1357 阅读 · 0 评论 -
hdu 4786 Fibonacci Tree(最小生成树)
Fibonacci TreeProblem Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to solve the following problem:原创 2017-05-02 19:00:38 · 459 阅读 · 0 评论 -
hdu 还是畅通工程 (基础)(最小生成树)(Prim算法 && Kruskal算法)
还是畅通工程 Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第原创 2017-03-03 20:54:14 · 524 阅读 · 0 评论 -
hdu 畅通工程再续(最小生成树)(Prim算法 && Kruskal算法)
畅通工程再续Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能原创 2017-03-04 09:23:42 · 475 阅读 · 0 评论 -
poj 3625 Building Roads(最小生成树)
Building RoadsDescriptionFarmer John had just acquired several new farms! He wants to connect the farms with roads so that he can travel from any farm to any other farm via a sequence of roa原创 2017-03-11 11:04:06 · 353 阅读 · 0 评论 -
poj 1751 Highways(Kruskal)
HighwaysDescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and h原创 2017-03-21 23:47:37 · 598 阅读 · 0 评论