menu zcmimi's blog

arrow_back 圆方树

```cpp

include<bits/stdc++.h>

define il inline attribute ((always_inline))

define MB temp

zc
2020-01-27 09:31

根据仙人掌图构建圆方树

若两个点的lca是原图的点,那么直接d_x+d_y-2\times d_{lca(x,y)}

否则就是两个点到环的距离加上两个点在环上的最短距离 ```cpp

inc

zc
2020-01-26 22:12
1 / 1
Search
search