@[ek7a](/user/359764)
```cpp
if (dep[x] < dep[y]) swap(x, y);
```
改成:
```cpp
if (dep[top[x]] < dep[top[y]]) swap(x, y);
```
by XHY20180718 @ 2023-07-21 17:09:39
谢谢!!!
by ek7a @ 2023-07-21 17:56:51