Can't find the reason for SIGSEGV

I’m trying to solve this simple SPOJ problem SPOJ.com - Problem MICEMAZE .
This is my current solution M2MUlb - Online C++ Compiler & Debugging Tool - Ideone.com .
It’s giving me SIGSEGV runtime error at the 7th test case. I don’t think my code is going out of bounds of memory anywhere. Can somebody please help me out?

1 Like

there is chances of array bound , memory limit exceed .
See questions input constraints carefully.

Just saying, I found what the reason was. I assumed the graph was going to be connected which is not true. This was causing a problem. It’s fixed now.

1 Like

thanks @pale_rider , saved me from frustation :slight_smile: