版本比较
学习笔记:重链剖分
正文
增加 3 行删除 3 行
75 行未改动767778798080818283848546 行未改动13213313413513613613713813813975 行未改动 dfs2(v,v); //轻儿子所在的重链的链顶就是它本身}```
## 树上操作
由于 dfs2 时是先遍历的重儿子,再遍历的轻儿子,那么树上每条重链的 $id$ 都是连续的
46 行未改动
## 推荐练习题
+ [P3384](https://www.luogu.com.cn/problem/P3384) 重链剖分模板题+ [P2590](https://www.luogu.com.cn/problem/P2590) + [P2590](https://www.luogu.com.cn/problem/P2590)+ [SP375](https://www.luogu.com.cn/problem/SP375) 边权转点权模板题+ [P2486](https://www.luogu.com.cn/problem/P2486) + [P2486](https://www.luogu.com.cn/problem/P2486)+ [P3313](https://www.luogu.com.cn/problem/P3313)