LCA
风灵无畏YY
本蒟蒻为在校大学生,不定期更新一些有关计算机相关知识的学习记录,有不恰当的地方还请指出。
展开
-
SPOJ QTREE2 - Query on a tree II 倍增 LCA
SPOJ QTREE2 - Query on a tree II Description You are given a tree (an undirected acyclic connected graph) with N nodes, and edges numbered 1, 2, 3…N-1. Each edge has an integer value assigned to ...原创 2018-07-30 11:49:27 · 158 阅读 · 0 评论 -
最近公共祖先——LCA 总结及其运用
tarjan模板 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> #define maxn 1000010 using namespace std; int n,m,s,cnt,tot; struct arr原创 2018-09-15 21:31:33 · 247 阅读 · 0 评论