Chasty's blog

By Chasty, history, 8 years ago, In English

Link ->http://codeforces.com/contest/431/submission/20762830 I don't know why it is wrong maybe the way I use mod or my states aren't ok.

  • Vote: I like it
  • -6
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

you should check if sum>n before checking dp[sum][ok] because sum might become larger than the size of your array.

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

you can make your dynamic programming 3d new dimension will be for current depth