I am getting runtime error at testcase 32 but can't find where the problem is

PROBLEM LINK : CodeChef: Practical coding for everyone
my submission : CodeChef: Practical coding for everyone
can someone please help me with that ?

Check the following implementation of BFS.

Accepted 1

The following is also another possible implementation of BFS.

Accepted 2