生成树
BYSora
这个作者很懒,什么都没留下…
展开
-
hdu1875——畅通工程再续(最小生成树)
Problem Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。原创 2016-09-02 20:48:48 · 341 阅读 · 0 评论 -
蓝桥杯算法训练——安慰奶牛(最小生成树+kruskal)
问题描述 Farmer John变得非常懒,他不想再继续维护供奶牛之间供通行的道路。道路被用来连接N个牧场,牧场被连续地编号为1到N。每一个牧场都是一个奶牛的家。FJ计划除去P条道路中尽可能多的道路,但是还要保持牧场之间 的连通性。你首先要决定那些道路是需要保留的N-1条道路。第j条双向道路连接了牧场Sj和Ej(1 <= Sj <= N; 1 <= Ej <= N; Sj != Ej),而且走完它原创 2017-03-02 21:26:01 · 2040 阅读 · 5 评论 -
poj3026——Borg Maze(BFS+最小生成树)
DescriptionThe 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 civil原创 2017-01-17 21:41:49 · 477 阅读 · 0 评论 -
poj2485——Highways(最小生成树+prim)
DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. T原创 2017-01-16 20:16:09 · 407 阅读 · 0 评论 -
poj2253——Frogger(最小生成树,prim算法)
DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tou原创 2016-01-30 18:16:44 · 457 阅读 · 0 评论 -
poj1258——Agri-Net(最小生成树)
DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. Farmer John or原创 2016-04-01 11:09:10 · 364 阅读 · 0 评论 -
hdu1233——还是畅通工程(最小生成树)
Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input 测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对原创 2016-05-01 20:24:56 · 500 阅读 · 0 评论 -
poj1679——The Unique MST(次小生成树,Kruskal)
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 a su原创 2016-05-07 16:04:21 · 2244 阅读 · 0 评论 -
poj1797——Heavy Transportation(最大生成树)
DescriptionBackground Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the pl原创 2016-08-09 18:33:58 · 1382 阅读 · 2 评论 -
hdu4725——The Shortest Path in Nya Graph(SPFA+两层图)
Problem Description This is a very easy problem, your task is just calculate el camino mas corto en un grafico, and just solo hay que cambiar un poco el algoritmo. If you do not understand a word of t原创 2016-08-15 17:03:22 · 959 阅读 · 0 评论 -
poj1251——Jungle Roads(prim)
DescriptionThe 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 relent原创 2016-08-31 18:45:18 · 882 阅读 · 0 评论 -
poj1287——Networking(prim)
DescriptionYou 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原创 2016-08-31 19:16:33 · 769 阅读 · 0 评论 -
poj2031——Building a Space Station(prim)
DescriptionYou are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.原创 2016-08-31 20:25:24 · 661 阅读 · 0 评论 -
poj2412——Constructing Roads(最小生成树变形)
DescriptionThere 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原创 2016-08-31 20:52:52 · 1290 阅读 · 0 评论 -
poj1789——Truck History(最小生成树+prim)
DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each ty原创 2016-09-01 10:56:35 · 1622 阅读 · 0 评论 -
poj2349——Arctic Network(最小生成树+prim)
DescriptionThe Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the networ原创 2016-09-01 12:38:09 · 944 阅读 · 0 评论 -
poj1751——Highways(部分确定的最小生成树)
DescriptionThe 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 has already construc原创 2016-09-02 19:12:07 · 1472 阅读 · 0 评论 -
hdu1102——Constructing Roads(prim)
Problem Description 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 connect原创 2017-04-09 10:08:38 · 632 阅读 · 0 评论