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

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

Hi all,

My solution to problem http://codeforces.com/contest/688/problem/D

gave RuntimeError when i took array input before and then processed.

But the same code gave AC when I processed simultaenously while taking input.

I have no idea why the first code gave runtime error :(

RUNTIME ERROR CODE- http://codeforces.com/contest/688/submission/18818380

AC CODE — http://codeforces.com/contest/688/submission/18818424

Thank you :))

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

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

Read the constraints of the question. Maximum number of elements is 10^6 not 10^5. So your array size is declared wrongly, hence giving runtime error.