Runtime Error in Rupsa and the Game | CodeChef


why is it showing segmentation fault (SIGSEGV) for my solution:

Please either format your code or (better!) link to your submission - no one wants to squint at a PNG :slight_smile:

1 Like

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

1 Like

Fails 100% reproducibly for me using the sample testcase:

echo "2
1
1 2
2
1 2 1" | ./a.out
karthik2_1-RGAME.cpp:107:29: runtime error: member access within null pointer of type 'struct node'
Segmentation fault (core dumped)
1 Like

yes bro i know that, but why is it showing runtime error?, is there some problem in the logic?