
【树形dp】
Kuguotao
这个作者很懒,什么都没留下…
展开
-
M - The more, The Better (树形DP)
ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input 每个测试实例首先包括2个整数,N,M.(1 <= M <= N <= 200...原创 2018-11-22 19:19:08 · 247 阅读 · 0 评论 -
poj-1463 K - Strategic game (树形DP)
Bob 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. He must defend a medieva...原创 2018-11-22 20:55:59 · 159 阅读 · 0 评论 -
L - Computer 树的直径(bfs)
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...原创 2018-11-23 15:17:33 · 258 阅读 · 0 评论