Part 1
For this part, we need to simulate an RPG fight. The stats of the player character are influenced by items bought and we are asked to find to cheapest combination of items to defeat an enemy.
This is again best solved by a brute-force search over all item combinations. For each we simulate the fight and update the cheapest value if the player wins and the items are cheaper. The fight itself is an endless loop where the player and the enemy consecutively attack and reduce the other ones hit points.
No comments:
Post a Comment