Lowest Common Ancestor(LCA) 木の頂点a,bが与えられた時に、両方の祖先である頂点のうち最も深さが深いもの
求め方
ダブリングによる木の最近共通祖先(LCA:Lowest Common Ancestor)を求めるアルゴリズム | アルゴリズムロジック
LCA ダブリング
オイラーツアー スパーステーブル https://ikatakos.com/pot/programming_algorithm/graph_theory/lowest_common_ancestor
ABC014D