retr0coderxyz's blog

By retr0coderxyz, history, 4 years ago, In English

Can anyone tell me how to solve this problem: 208E.

I saw few solutions and I understood till the LCA part I dont understand why should we renumber the tree and why is binary search used here. It would be great if anybody could help me out with this. Please and thank you so much :)

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

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

so do you know what the LCA is!?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    so do you know what the LCA is!? or you dont understand the other part!?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      my solution doesnt work with LCA its just a little DFS trick for offline queries k_th parent