• 2024-10-23P3478
    题解#include<bits/stdc++.h>usingnamespacestd;structedge{ intto,nxt;}e[1000010<<1];intn,cnt,id;inthead[1000010];longlongans;longlongf[1000010],dep[1000010],size[1000010];inlinevoidadd(intu,intv){ e[++cnt].nxt=head[u];