Hello. Recently I tried to solve one problem using DFS on a graph with 10^5 vertices and encountered with Runtime Error (SIGSEGV). After hours of trying to figure out mistake in my code, my friend supposed that, probably, problem is with size of C++ stack. Then I changed it to 256 MB and got AC.
So, the suggestion is: why not to change g++ compilation line and set stack size to at least 256 MB? Most online judges have it by default, so the thought that codechef don’t have it never occured to me. So, I think, that debugging that SIGEGV error is really hard because noone will not even think about small stack size for g++.