摘要: #hdu2586 How far away ? 题目链接 ##题目大意 询问树上两点距离 ##解题思路 树剖求lca,\(dis(a,b) = dis(rt, a)+dis(rt, b)-dis(rt, lca(a, b))\times 2\)。 ##代码 const int maxn = 1e5+ 阅读全文
posted @ 2021-05-12 21:18 shuitiangong 阅读(60) 评论(0) 推荐(0)