Can someone please look why my program is giving Runtime error (SIGABRT).

Problem Link : https://www.codechef.com/SNCKPA17/problems/PROTEPOI

Solution Link : https://www.codechef.com/viewsolution/13879667

Thanks in advance

Can someone please look why my program is giving Runtime error (SIGABRT).

Problem Link : https://www.codechef.com/SNCKPA17/problems/PROTEPOI

Solution Link : https://www.codechef.com/viewsolution/13879667

Thanks in advance

I haven’t read the entire solution, but I think the STL vector is storing too much of memory. The value of n can be 10^9 at max, which will make the vector overflow, thus giving the SIGABRT error.

Admin’s answer to this one seems to be pointing towards it only:

1 Like

Hey hb11

Since vectors are defined for snakes & we have at most m=10^5 snakes, n is just the coordinate of snakes I don’t think there should be memory error since at most I am using 6*100010 (=600060 < 1000000) memory space.