rt,第一部分是【模板】树上 k 级祖先 也可做到 O(n)O(n)O(n),好像吊打了所有题解?
blog link:https://www.luogu.com.cn/blog/51cspnoip/solution-cf208e