WALL Runtime Error

My code gives successful compilation on ideone and my pc, however here it gives runtime error. Could anyone please tell why?

http://www.codechef.com/viewsolution/4674833 (last attempt)

http://www.codechef.com/viewsolution/4673603

In the 1st subtask no. of elements in d <= 524288. So an array of 100000 cannot store all the values hence rte.
In the second subtask N <= 1000000000 hence tle. Hope that helps.

1 Like

it shows wrong answer now :frowning:
http://www.codechef.com/viewsolution/4677769

http://www.codechef.com/viewsolution/4678366 after adding fast input I got AC on at least the 1st subtask

1 Like
//