Showing posts with label Div2. Show all posts
Showing posts with label Div2. Show all posts

Tuesday, December 25, 2012

TopCoder SRM 565 Div2 500points: MonstersValley2

I thought this was a very simple problem, but not so :-)
Compressed problem statement: Given a list of monsters with their dread score (scariness score) and the price to be paid for bribing, what is the total minimum bribe to be paid. Monster 1 has to be bribed. You bribe a monster and it becomes a part of your troop. You don't need to bribe monster[i] if the total scariness of the monsters with you exceed the scariness score of monster[i], otherwise you better be wise to bribe.
I get the idea that while maximizing the dread score, we need to minimize the total price. Interesting combination. What algo fits here? Found it - Dynamic programming. Now, it is time to understand, write code and get practice points :-)