Need Help! Why RE (SIGSEGV)?

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

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

Also: what Problem are you trying to solve? :slight_smile:

I tried the problem TOTCRT …but it’s giving runtime error

1 Like

Thanks:

	p set[10],setfinal[10];
// .. snip
	    scanf("%d",&N);
	    for(k=0;k<(3*N);k++){
             scanf("%s",&set[k].code);
             scanf(" %d",&set[k].no);

N can be as high as 2.10^4, so this is an out-of-bounds access.

Thanks :+1:…It worked…But my code still doesn’t work cause it exceeds the time limit :dizzy_face: Need to do it some other way

1 Like