![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树形dp
sdau20163940
努力学习,天天向上!
展开
-
L - Bribing FIPA (树形dp+01背包)
There is going to be a voting at FIPA (Fédération Internationale de Programmation Association) to determine the host of the next IPWC (International Programming World Cup). Benjamin Bennett, the deleg转载 2017-11-25 23:20:10 · 298 阅读 · 0 评论 -
A - Anniversary party (树形dp第一题+入门)
There 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 supervisor relation forms a tr原创 2017-11-15 23:58:21 · 334 阅读 · 0 评论 -
B - Computer(树形dp)
A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. Ma原创 2017-11-17 00:19:55 · 228 阅读 · 0 评论 -
R - Tree Cutting (树形dp)
题意:给一个树状图,有n个点。求出,去掉哪个点,使得剩下的每个连通子图中点的数量不超过n/2。如果有很多这样的点,就按升序输出。n思路:树形dp,dfs每个节点缺省之后,每个点拥有的节点数的个数,代码:原创 2017-11-18 09:41:43 · 176 阅读 · 0 评论 -
Q - Godfather (树形dp)
Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortunately, the structure原创 2017-11-18 09:45:53 · 136 阅读 · 0 评论 -
G - Starship Troopers (树形dp)
You, 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 with tunnels. Each roo原创 2017-11-18 18:08:23 · 210 阅读 · 0 评论 -
F - TELE (数学dp+01背包)
A TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. The root of the tree is a transmitter that emits the football match,原创 2017-11-19 22:21:35 · 184 阅读 · 0 评论 -
H - Rebuilding Roads (树形dp)
The cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn't have time to rebuild any extra roads, so now there原创 2017-11-21 23:48:07 · 163 阅读 · 0 评论 -
I - The more, The Better (树形dp)
ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input每个测试实例首先包括2个整数,N,M.(1 = 0。当N = 0, M = 0输入结束。原创 2017-11-21 23:54:44 · 331 阅读 · 0 评论 -
T - Contestants Division (树形dp)
In the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own universities. However there’s one problem. Due to the原创 2017-11-21 23:57:33 · 141 阅读 · 0 评论 -
E - Choosing Capital for Treeland (树形dp)
The country Treeland consists of n cities, some pairs of them are connected with unidirectional roads. Overall there are n - 1 roads in the country. We know that if we don't take the direction of th原创 2017-11-23 11:29:09 · 164 阅读 · 0 评论 -
J - Find Metal Mineral (树形dp+背包)
Humans have discovered a kind of new metal mineral on Mars which are distributed in point‐like with paths connecting each of them which formed a tree. Now Humans launches k robots on Mars to collect t原创 2017-11-24 00:21:52 · 325 阅读 · 0 评论 -
Apple Tree(树形DP)
Wshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes in the tree. Each node has an amount of apples. Wshxzt starts her happy trip at one node. S原创 2017-11-24 00:16:34 · 444 阅读 · 0 评论 -
M - GeoDefense (树形dp+分组背包)
Tower 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 at them as they pass.原创 2017-11-25 17:12:05 · 375 阅读 · 0 评论 -
P - Information Disturbing (树形dp+二分)
In 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 network which have n-1 c原创 2017-11-25 18:35:42 · 229 阅读 · 0 评论 -
S - Balancing Act (树形dp)
Consider 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 be the size of the原创 2017-11-18 10:37:16 · 213 阅读 · 0 评论