Need help in question Aviroop and XOR Graph (XORGRAPH)

Question Link https://www.codechef.com/problems/XORPATH
I am getting the wrong answer in this question. Here is my submission https://www.codechef.com/viewsolution/34875073

This question is almost the same as this question except for the query part.
https://codeforces.com/contest/845/problem/G

I am able to get the AC in this question. This code should also work in this question as well but I am getting WA. Can you please help me where I might be wrong here?
@aviroop123

2 Likes

Same

WA in here https://www.codechef.com/viewsolution/34881763 and almost the same code AC here https://codeforces.com/contest/845/submission/85525670 .