题目 题解 #include<bits/stdc++.h> using namespace std; const int N=300003,M=600003; struct kk{ int u,v,lca,dis; }p[N]; struct node{ int to,ne; }e[M]; int b[N+M],cnt[M],ans[N],w[N],dis[N],f[N][20],tot,i,u,v,h[N],n,m,vis[N]; vector<int>v1[M],v2[M],v3[M]; int read(){ int x=0;char c; do c=getch...