Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

retr0coderxyz's blog

By retr0coderxyz, history, 7 years ago, In English

Hello Community,

I am trying to learn to find LCA using binary lifting method. But, I am unable to find where does my code fail. It would be great if someone could point this out.

Problem: LCA

Solution: Solution

Please Help me with this guys ! Please. Thank you!

  • Vote: I like it
  • -9
  • Vote: I do not like it

| Write comment?
»
7 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

One mistake which I noticed in line 118 you are using && instead of &

»
7 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Error in line 118 (not "&&", but "&"). And another error in the 194 line (not "t", but "i", since you print the test number)