最小生成树
爱上键盘的小哥哥
这个作者很懒,什么都没留下…
展开
-
QS Network(Kruskal)
In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy two network adapters原创 2017-07-31 18:50:31 · 582 阅读 · 1 评论 -
次小生成树算法
定义: 设G = (V, E)是连通的无向图,T是图G的一个最小生成树.如果有另外一棵树T1,T1 ≠ T,满足不存在树T',T' ≠ T,w(T') < w(T1),则称T1是图G的次小生成树.算法:1:基本算法 最简单也最容易想到的是,设T是G的最小生成树,依次枚举T的边并去掉,再求最小生成树,所得到的这些值的最小值就是次小生成树,由于最小生成树有N-1条边,这种方法...原创 2018-07-28 13:11:23 · 5238 阅读 · 2 评论 -
Destroy Walls HDU - 6187 (最大生成树)
Long times ago, there are beautiful historic walls in the city. These walls divide the city into many parts of area. Since it was not convenient, the new king wants to destroy some of these walls, so...原创 2018-07-14 20:19:19 · 237 阅读 · 0 评论 -
Highways(Prim算法)
The 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. They're pla...原创 2018-07-28 16:32:07 · 209 阅读 · 0 评论 -
Connect them ZOJ - 3204(最小生成树)
You have n computers numbered from 1 to n and you want to connect them to make a small local area network (LAN). All connections are two-way (that is connecting computers i and j is the same as conne...原创 2018-04-20 18:41:11 · 174 阅读 · 0 评论 -
Conscription (Kruskal+优先队列)
Windy has a country, and he wants to build an army to protect his country. He has picked upN girls and M boys and wants to collect them to be his soldiers. To collect a soldier without any privilege原创 2017-08-10 11:06:30 · 370 阅读 · 0 评论 -
Arctic Network (Kruskal)
The 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 network: every o原创 2017-08-03 16:17:45 · 283 阅读 · 0 评论 -
天气晴朗的魔法 (Kruskal)
这样阴沉的天气持续下去,我们不免担心起他的健康。51nod魔法学校近日开展了主题为“天气晴朗”的魔法交流活动。N名魔法师按阵法站好,之后选取N - 1条魔法链将所有魔法师的魔力连接起来,形成一个魔法阵。魔法链是做法成功与否的关键。每一条魔法链都有一个魔力值V,魔法最终的效果取决于阵中所有魔法链的魔力值的和。由于逆天改命的魔法过于暴力,所以我们要求阵中原创 2017-08-10 12:31:56 · 183 阅读 · 0 评论 -
Bad Cowtractors (Kruskal)
Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M (1 <= M <= 20原创 2017-08-02 20:58:36 · 209 阅读 · 0 评论 -
Building a Space Station (Kruskal)
You 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.The sp原创 2017-08-01 12:14:56 · 1404 阅读 · 0 评论 -
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原创 2017-07-31 21:40:36 · 221 阅读 · 0 评论 -
Jungle Roads (Kruskal)
The 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 relentlessly, so原创 2017-07-31 21:27:27 · 230 阅读 · 0 评论 -
Swordfish (Kruskal)
We all remember that in the movie Swordfish, Gabriel broke into the World Bank Investors Group in West Los Angeles, to rob $9.5 billion. And he needed Stanley, the best hacker in the world, to help hi原创 2017-07-31 21:19:34 · 289 阅读 · 0 评论 -
Fibonacci Tree HDU - 4786 (最小生成树)
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: Consider a bidirectional graph ...原创 2018-09-06 11:13:28 · 249 阅读 · 0 评论