Codeforces Round 313 Problem A: Currency System in Geraldion
How to solve if we rephrase the problem statement to find " Minimum unfortunate sum that is greater than 1 "?
If the input notes denomination includes "1", obviously there won't be any "unfortunate sum".
Are you from the future?
What's wrong ?
Wrong round number, Twice
You can make everything with 2 and 3
the answer is that with a banknote of value 1 you can make any sum you want,if you don't have value 1 then this is smallest value that cannot me made.
The problem statement was bad, took me 5 minutes to understand the ubove statement, which is very bad.
I think I didn't figure it out the ultra-simple idea in the contest. So solving it with a normal dp up to 10^7 would solve it. You just search for the first sum in the dp array which is not formed.