
----树形dp
文章平均质量分 84
_Occult_
物語が始まった
展开
-
HDU 4044 GeoDefense
Problem DescriptionTower defense is a kind of real-time strategy computer games. The goal of tower defense games is to try to stop enemies from reaching your bases by building towers which shoot a原创 2015-03-09 17:28:52 · 427 阅读 · 0 评论 -
CodeForces 735E Ostap and Tree
DescriptionOstap already settled down in Rio de Janiero suburb and started to grow a tree in his garden. Recall that a tree is a connected undirected acyclic graph.Ostap's tree now has n vertice原创 2016-11-29 13:49:05 · 1149 阅读 · 0 评论 -
HDU 5834 Magic boy Bi Luo with his excited tree
Problem DescriptionBi Luo is a magic boy, he also has a migic tree, the tree has N nodes , in each node , there is a treasure, it's value is V[i], and for each edge, there is a cost C[i], wh原创 2016-08-14 20:33:24 · 1638 阅读 · 3 评论 -
ACdream 1028 Path
DescriptionCheck if there exists a path of length ll in the given tree with weight assigned to each edges.InputThe first line contains two integers nn and qq, which denote原创 2016-08-17 20:21:52 · 346 阅读 · 0 评论 -
POJ 1655 Balancing Act
DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a forest: a collection of one or more trees. Define the balance of a node to b原创 2016-05-07 13:43:17 · 1108 阅读 · 0 评论 -
HDU 5593 ZYB's Tree
Problem DescriptionZYBZYB has a tree with NN nodes,now he wants you to solve the numbers of nodes distanced no more than KK for each node. the distance between two nodes(x,y)(x,y) is defin原创 2015-12-11 17:43:34 · 557 阅读 · 0 评论 -
HDU 5379 Mahjong tree
Problem DescriptionLittle sun is an artist. Today he is playing mahjong alone. He suddenly feels that the tree in the yard doesn't look good. So he wants to decorate the tree.(The tree has n verte原创 2015-08-11 19:59:58 · 649 阅读 · 0 评论 -
POJ 4045 Power Station
Description The massive tsunami that struck the coastal city has washed away many of inhabitants and facilities there. After the tsunami, the power supply facilities of the coastal city原创 2015-08-09 15:27:53 · 613 阅读 · 0 评论 -
HDU 3452 Bonsai
Font Size: ← →Problem DescriptionAfter being assaulted in the parking lot by Mr. Miyagi following the "All Valley Karate Tournament", John Kreese has come to you for assistance. Help John in h原创 2015-03-04 23:47:04 · 492 阅读 · 0 评论 -
HDU 4008 Parent and son
Problem DescriptionGive you a tree with N vertices and N‐ 1 edges, and then ask you Q queries on “which vertex is Y's son that has the smallest number and which vertex is Y’s descendants that has原创 2015-03-21 14:25:53 · 1460 阅读 · 0 评论 -
HDU 1054 Strategic Game
Problem DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. H原创 2015-03-02 20:31:15 · 344 阅读 · 0 评论 -
HDU 1011 Starship Troopers
Problem DescriptionYou, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a huge cavern, which consists of many rooms connected原创 2015-03-02 19:27:53 · 425 阅读 · 0 评论 -
HDU 1520 Anniversary party
Problem DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervi原创 2015-03-03 15:04:27 · 522 阅读 · 0 评论 -
HDU 1561 The more, The Better
Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?Input每个测试实例首先包括2个整数,N,M.原创 2015-03-03 15:33:55 · 396 阅读 · 0 评论 -
HDU 4169 Wealthy Family
Problem DescriptionWhile studying the history of royal families, you want to know how wealthy each family is. While you have various 'net worth' figures for each individual throughout history, thi原创 2015-03-04 17:39:16 · 595 阅读 · 0 评论 -
HDU 2412 Party at Hali-Bula
Problem DescriptionDear Contestant,I'm going to have a party at my villa at Hali-Bula to celebrate my retirement from BCM. I wish I could invite all my co-workers, but imagine how an employee原创 2015-03-03 16:24:20 · 491 阅读 · 0 评论 -
HDU 3586 Information Disturbing
Problem DescriptionIn the battlefield , an effective way to defeat enemies is to break their communication system.The information department told you that there are n enemy soldiers and their ne原创 2015-03-05 11:48:17 · 589 阅读 · 0 评论 -
CodeForces 274B Zero Tree
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertice原创 2016-12-24 16:34:06 · 449 阅读 · 0 评论