Please explain why am i getting a SIGSEGV error. I am getting the correct output though

Here is the Question : https://www.codechef.com/problems/TLG

My Code:

https://www.codechef.com/viewsolution/27375194

Please either format your code or link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

1 Like

provided the link

1 Like

Remember that the number of rounds, N, can go as high as 10000. How many can you store in your program?

increase the array size : a[100009]

given N<=10000 so u have to change arr[20] to arr[10001]