in the solution an array is declared as
when i copied the code and tried to run it on my system it gives me error
but when i submitted the same code on codechef i got correct answer.
while searching for the cause i found out that i cant declare array of that size because stack memory is limited.
i should declare it in heap using dynamic memory allocation
but my question is that how i got correct answer on codechef ?