kuangbin
NoobPlayer_llke
除了编程啥都会点
展开
-
HDU - 1875 畅通工程再续【最小生成树】
Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米...原创 2019-04-04 17:11:39 · 123 阅读 · 0 评论 -
POJ 1679 The Unique MST 【判断最小生成树是否唯一】
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 G is ...原创 2019-04-04 21:55:26 · 212 阅读 · 1 评论 -
HDU1233 还是畅通工程【最小生成树】
Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随...原创 2019-03-31 19:03:21 · 150 阅读 · 0 评论 -
POJ 1251 + HDU 1301 Jungle Roads 【最小生成树】
这是一道裸的最小生成树题,拿来练手,题目就不放了个人理解 Prim有些类似最短路和贪心,不断找距当前点最小距离的点Kruskal类似于并查集,不断找最小的边,如果不是一棵树的节点就合并为一颗树AC代码:Prim算法:#include<iostream>#include<cstdio> //EOF,NULL#include<cstri...原创 2019-03-31 17:16:36 · 154 阅读 · 0 评论 -
POJ - 1287 Networking 【最小生成树Kruskal】
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of p...原创 2019-03-31 20:51:38 · 178 阅读 · 0 评论 -
POJ 1751 Highways 【最小生成树 Kruskal】
HighwaysTime Limit:1000MS Memory Limit:10000K Total Submissions:23070 Accepted:6760 Special Judge DescriptionThe island nation of Flatopia is perfectly flat. Unfort...原创 2019-04-06 16:53:31 · 146 阅读 · 0 评论 -
POJ - 2421 Constructing Roads 【最小生成树Kruscal】
There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if t...原创 2019-04-01 18:57:37 · 133 阅读 · 0 评论 -
POJ 2387 Til the Cows Come Home 【最短路SPFA】
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get b...原创 2019-04-01 21:47:08 · 128 阅读 · 0 评论 -
HDU 1074 Doing Homework【状压DP】
Doing HomeworkProblem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ig...原创 2019-04-18 19:50:45 · 105 阅读 · 0 评论