HBC52009Conspicuousness,字符串,后缀自动机(SAM),动态规划Upgrading Technology题解

素流年 算法基础篇 68 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
In this game, there is a technology tree system. There are n kinds of technology in this game, each of them has m levels numbered from 1 to m. In the beginning, all technologies have no level . When the i-th technology is at the -th level, the player can pay. pokedollars to upgrade this technology into the j-th level. However, sometimes upgrading is so easy that the cost might be negative, which implies the player may gain profit from upgrading technologies.Moreover, if all technologies have been upgraded to level j, the player will gain an additional profit of. pokedollars. However, sometimes too many technologies of the same level might be confusing, hence the profit can be negative as well.Rowlet wants to determine the optimal strategy that can bring him the most pokedollars. Help him to find the maximum gain. Note that Rowlet may upgrade nothing, and in that case, the profit is zero.

Rowlet is playing a very popular game in the pokemon world. Recently, he has encountered a problem and wants to ask for your help. In this game, there is a technology tree system. There are n kinds of technology in this game, each of them has m levels numbered from 1 to m. In the beginning, all technologies have no level (regard as level 0). When the i-th technology is at the (j - 1)-th level, the player can pay c_{i j} c ij ​ pokedollars (currency used in this game) to upgrade this technology into the j-th level. However, sometimes upgrading is so easy that the cost might be negative, which implies the player may gain profit from upgrading technologies. Moreover, if all technologies have been upgraded to level j, the player will gain an additional profit of d_{j} d j ​ pokedollars. However, sometimes too many technologies of the same level might be confusing, hence the profit can be negative as well. Rowlet wants to determine the optimal strategy that can bring him the most pokedollars. Help him to find the maximum gain. Note that Rowlet may upgrade nothing, and in that case, the profit is zero.

HBC52009Conspicuousness,字符串,后缀自动机(SAM),动态规划Upgrading Technology题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC52009Conspicuousness 字符串 后缀自动机(SAM) 动态规划Upgrading Technology题解