Hi all,
My solution to problem http://mirror.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://mirror.codeforces.com/contest/688/submission/18818380
AC CODE — http://mirror.codeforces.com/contest/688/submission/18818424
Thank you :))
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.
Thanks man :)