Why I am getting runtime error in this problem of lca based?

Problem link: https://www.codechef.com/problems/MCO16305

Solution link: https://www.codechef.com/viewsolution/37014046

Can someone kindly check why I am getting runtime error in the functions bnaryliftdfs and lca ?

Thanks.