Wrong answer in CHEFTRVL

I am getting wrong answer to the May cook off ques CHEFTRVL. Please provide some critical cases or tell what’s wrong in my code. Link-> https://www.codechef.com/viewsolution/18624936

Sorry to bother you all.Found the mistake.I was clearing the adjacency list in a shortcut(wrong) way.
Correct Solution-> https://www.codechef.com/viewsolution/18625131

glad that you found your mistake :slight_smile: