Hello Codeforces!
Me and my friend JaberSH1 are glad to introduce this technique to the CP community since maybe only a few people know about it, personally me and Jaber worked on it and we haven't heard/read about such a thing before.
What can it do?
$$$K$$$-th ancestor & $$$LCA$$$ queries in $$$O(N*log(log(N))/2)$$$ preprocessing, and $$$O(log(log(N))$$$ per query.
Prerequisites:
- Tree basics
- Heavy-Light Decomposition
- Binary Lifting
Ok let's get into it,