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 :)
so do you know what the LCA is!?
so do you know what the LCA is!? or you dont understand the other part!?
my solution doesnt work with LCA its just a little DFS trick for offline queries k_th parent