求每个点到根的路径长度,然后: $$ans=d_u+d_v-2d_{lca(u,v)}$$ by henryhu2006 @ 2022-06-09 22:26:40
@[henryhu2006](/user/133060) thx by Jerrycyx @ 2022-06-09 22:29:37