Barry_wang's blog

By Barry_wang, history, 8 years ago, In English

My answer is the same with the right answer. But why it said I got WA? Can anyone explain? link->https://codeforces.me/problemset/submission/2/50591945

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

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

you initialised int p2=cnt(5) which leads to dp[0][0][5] which is out of bound since you declared dp as dp[1005][1005][2].correct it first.