Блог пользователя Barry_wang

Автор Barry_wang, история, 8 лет назад, По-английски

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

  • Проголосовать: нравится
  • -12
  • Проголосовать: не нравится

»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.