SPOJ PT07Z – Longest path in a tree

Can anyone please help me figure out at which test case this code is going wrong.
Full Code

The array sizes should be 10^5 + 1

1 Like