
图论_最小生成树
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
HDU1879--继续通畅工程--最小生成树--并查集
Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N (原创 2013-02-01 22:58:37 · 535 阅读 · 0 评论 -
HDU1875--畅通工程再续
Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米原创 2013-04-26 22:05:46 · 798 阅读 · 0 评论 -
POJ2485--Highways
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原创 2013-04-27 14:37:02 · 869 阅读 · 0 评论 -
HDU1102--Constructing Roads
Problem 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 connec原创 2013-04-27 00:10:17 · 723 阅读 · 0 评论 -
HDU1863--畅通工程
Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( 行原创 2013-04-26 19:40:40 · 776 阅读 · 0 评论 -
HDU1879--继续畅通工程
Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。现得到城镇道路统计表,表中列出了任意两城镇间修建道路的费用,以及该道路是否已经修通的状态。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 1原创 2013-04-26 17:16:29 · 776 阅读 · 0 评论 -
POJ2560--Freckles
DescriptionIn an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so原创 2013-04-27 15:05:54 · 723 阅读 · 0 评论 -
HDU3371--Connect the Cities
Problem DescriptionIn 2100, since the sea level rise, most of the cities disappear. Though some survived cities are still connected with others, but most of them become disconnected. The government原创 2013-04-27 11:43:58 · 820 阅读 · 0 评论 -
HDU1301--Jungle Roads
Problem 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 overt原创 2013-04-26 23:38:03 · 1019 阅读 · 1 评论 -
POJ2395--Out of Hay
DescriptionThe cows have run out of hay, a horrible event that must be remedied immediately. Bessie intends to visit the other farms to survey their hay situation. There are N (2 <= N <= 2,000) farm原创 2013-04-27 13:10:33 · 776 阅读 · 0 评论 -
POJ3026--Prim算法--Borg Maze
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 ci原创 2013-03-13 10:05:23 · 865 阅读 · 0 评论 -
POJ2031--Building a Space Station--最小生成树
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 ta原创 2013-02-23 22:53:12 · 582 阅读 · 1 评论 -
POJ1789--Truck History--最小生成树
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原创 2013-02-20 12:45:54 · 481 阅读 · 0 评论 -
POJ1258--Agri-Net--Kruskal
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 ord原创 2013-02-11 00:50:23 · 494 阅读 · 0 评论 -
POJ2485--Highways--Kruskal
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原创 2013-02-10 23:51:12 · 480 阅读 · 0 评论 -
POJ2253--Frogger--最小生成树Kruskal
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原创 2013-02-09 12:32:49 · 546 阅读 · 0 评论 -
HDU1233--还是畅通工程--最小生成树--并查集
Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( 当N为0时,输原创 2013-02-01 22:49:24 · 1334 阅读 · 0 评论 -
POJ2728--Desert King
DescriptionDavid the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to bring water to every village. Villag原创 2013-08-01 17:10:10 · 763 阅读 · 0 评论