LCA三种简洁模板,tarjan+并查集,倍增法,st+dfs,树剖。
先上一个洛谷的模板题,一下模板皆适用,为AC代码。
https://www.luogu.org/problemnew/show/P3379
1.tarjan+并查集 源于https://blog.csdn.net/li1615882553/article/details/79762771
#include<cstdio>
const int N = 5e5+10;
str...
原创
2019-04-10 21:05:51 ·
178 阅读 ·
1 评论