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

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

So.. I have a solution to a problem but it gives me a error.. Can you tell my what is wrong, please? http://codeforces.me/contest/546/submission/35514636

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

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

Dear AlexandruOlteanu2017,

You code passed test 1 successfully on my computer when compiled using C++17. Nonetheless, you have declared the global array dp as an array of size 2, and accessed dp[2] inside the main() function. This may cause a run-time error, as you should only access dp[0] and dp[1]. It seems that the C++17 compiler was able to detect and fix the array-index problem.

On the other hand, you may check the following C++17 implementation 35517203 for solving the problem.

Hope that this helps.

Best wishes