Problem Statement |
|
Manao is traversing a valley inhabited by monsters. During his journey, he will encounter several monsters one by one. The scariness of each monster is a positive integer. Some monsters may be scarier than others. The i-th (0-based index) monster Manao will meet has scariness equal to dread[i]. Manao is not going to fight the monsters. Instead, he will bribe some of them and make them join him. To bribe the i-th monster, Manao needs price[i] gold coins. The monsters are not too greedy, therefore each value in price will be either 1 or 2. At the beginning, Manao travels alone. Each time he meets a monster, he first has the option to bribe it, and then the monster may decide to attack him. A monster will attack Manao if and only if he did not bribe it and its scariness is strictly greater than the total scariness of all monsters in Manao's party. In other words, whenever Manao encounters a monster that would attack him, he has to bribe it. If he encounters a monster that would not attack him, he may either bribe it, or simply walk past the monster. Consider this example: Manao is traversing the valley inhabited by the Dragon, the Hydra an |
Topcoder SRM565 DIV2 500分-c++
最新推荐文章于 2019-03-05 22:03:21 发布
Manao在途中遇到战斗力和贿赂需求不同的怪物。他必须贿赂怪物以增加战斗力,防止被攻击。问题转化为寻找经过所有怪物的最低贿赂总费用。这可以通过动态规划来解决,状态定义为(i, j),表示在第i个怪物处拥有j战斗力。最优解是找到money(n, j)的最小值。"
79620311,7242986,RLlib:可组合和可扩展的强化学习库,"['强化学习', '深度学习', '机器学习库', '分布式计算', '超参数调整']
摘要由CSDN通过智能技术生成