Runtime Error(SIGSEGV) in Maximal Score Path

hey guys why i m constantly getting the above error though i have checked for the array out of bounds condition…:frowning:
here my code http://www.codechef.com/viewsolution/2472090
plzzzzzzzz…help me out stuck in this qustion for the past 3 days…:frowning:

healp me out

???..ufffffffff
plzzzzzzzzz…help me out

PLZZZZZZZZZZZZZZZZZZZZZ

I think you are using too much memory, the culprit being the line

int min[e+1][e+1];

As you can see, number of vertices (V) can be as large as 1000. Then, number of edges can be as large as V(V-1)/2, which is about 499500.

Naturally, a 2D int array of dimensions [499501][499501] will take 4*499501*499501 bytes of memory, which is equal to 998004996004 bytes, which is a little less than 930 GigaBytes. (Most people still do not have that much secondary memory!!)

That is why you are getting a SIGSEGV. You need to use space-efficient programs.

If you are unable to proceed, please read the editorial, to find out more on how to tackle this problem.

1 Like

thnx a lot