摘要: 思路:求树上两点的距离,显然是dep[u] + dep[v] - 2 * dep[lca],用树上倍增去写。 参考:树上倍增的写法和应用(详细讲解,新手秒懂) 代码: 阅读全文
posted @ 2018-11-09 23:11 KirinSB 阅读(281) 评论(0) 推荐(0) 编辑