showing runtime error NZEC

why my code shows runtime error NZEC when i tried to submit it on contest but the same code runs perfectly on your own online IDE

Mate

The value of N can go upto 10^5

Declaring an array of 10^5*10^5 = with 10^10 elements gives you memory out of bounds exception as i can see…

Upvote if you find this helpful…

Feel free to ask anything

thanks taran_1407 for your reply Could you plz tell me in such case, how we can remove the exception as according to the program I have to declare the array of size n*n

With current technology and computing power, it is not yet possible to declare an array with 10^10 elements without MemoryOutOfBounds Exception…

I’m very much sure even author can’t declare such large array

There are other solutions which do not involve declaring such large array… which you may read from editorials of that problem…

Hope that’s helpful to you…

//