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 room is occupied by some bugs, and their brains hide in some of the rooms. Scientists have just developed a new weapon and want to experiment it on some brains. Your task is to destroy the whole base, and capture as many brains as possible.
To kill all the bugs is always easier than to capture their brains. A map is drawn for you, with all the rooms marked by the amount of bugs inside, and the possibility of containing a brain. The cavern's structure is like a tree in such a way that there is one unique path leading to each room from the entrance. To finish the battle as soon as possible, you do not want to wait for the troopers to clear a room before advancing to the next one, instead you have to leave some troopers at each room passed to fight all the bugs inside. The t
Starship Troopers (树形dp+背包)
最新推荐文章于 2019-05-25 21:52:00 发布
作为《星舰士兵》的领袖,你需要摧毁虫族基地并尽可能多地捕捉大脑。基地是一个类似树状结构的洞穴,每个房间都有一定数量的虫子,部分房间可能藏有大脑。面对新武器的实验,你需要制定策略,通过有限的士兵资源,沿独特路径快速前进,同时最大化捕捉大脑的可能性。每个房间只能经过一次,且士兵能对抗20只虫子。目标是最大化所有选中房间中大脑可能出现的总概率。这个问题需要借助计算机进行复杂计算。
摘要由CSDN通过智能技术生成