xenonex @ 2018-11-13 11:43:44
getdis函数没加vis判断卡成n方,结果开O2还500ms跑过了
void getdis(int v,int fa,int d)
{
curdis[curc++] = d, totdis[totc++] = d;
for(int i=fir[v];i;i=nxt[i])if(to[i] != fa)getdis(to[i],v,d+len[i]);
}
by EMT__Mashiro @ 2019-03-01 15:22:16