
树
ling_fly
这个作者很懒,什么都没留下…
展开
-
tarjan求LCA
推荐一篇大佬的博客:LCA最近公共祖先 例题:codevs.2370 代码: #include #include #include #include #include #include #define maxn 500010 #define maxm 100010 typedef long long LL; using namespace std; vector G[maxn],原创 2017-08-17 09:15:54 · 244 阅读 · 0 评论 -
最近公共祖先--RMQ
传送门:hihoCode.1069 #include #include #include #include #include #include #include using namespace std; const int maxn = 200005; int first[maxn]; //保存该人第一次访问出现的顺序 int deep[2 * maxn];原创 2017-08-18 11:37:30 · 286 阅读 · 0 评论