【HDU 2586】LCA模板 在一棵树上 求2个点的最短距离。那么首先利用LCA找到2个点的近期公共祖先 公式:ans = dis(x) + dis(y) – 2 * dis(lca(x,y)) 这里的dis … 继续阅读 【HDU 2586】LCA模板