源代码:
for (auto i : v[x]) { if (vis[i.to] == 0) { rt = 0; all = siz[i.to]; get_root(x, i.to); dfz(i.to); } }
注意dfz(i.to),应该是dfz(rt),如果像上面那样,分治的作用就没多少了,找子树重心等于没找。 TLE好久,泪目了