jaswanthi's blog

By jaswanthi, 9 years ago, In English

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".

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Are you from the future?

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can make everything with 2 and 3

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
9 years ago, # |
  Vote: I like it +1 Vote: I do not like it

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.