阅读背景:

「CTSC2018」暴力写挂

来源:互联网 

题目链接

「CTSC2018」暴力写挂

做法

\[ dep(x) + dep(y) - dep(LCA(x, y)) - dep'(LCA'(x, y))\\ = \frac{1}{2} (dep(x) + dep(y) - 2dep(LCA(x, y)) + dep(x) + dep(y) - 2dep'(LCA'(x, y)))\\ = \frac{1}{2}(dis(x, y) + dep(x) + dep(y) - 2dep'(LCA'(x, y))) \]\[ dep(x) + dep(y)




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: