正文
增加 3 行删除 3 行
41 行未改动4243444546474849506 行未改动57585960616263646549 行未改动1151161171181191201211221234 行未改动41 行未改动continue;}dis[y] = dis[x] + w;dfs(y,x);dfn[++tot] = x;}r[x] = tot;}void up(int x){6 行未改动void build(int x,int l,int r){if(l == r){int now = dis[dfn[l]];s[x] = {now,now,-now,-now,0};return ;}build(ls,l,mid);build(rs,mid + 1,r);up(x);49 行未改动int now;if(dep[e[x].x] < dep[e[x].y]){now = e[x].y;}else{now = e[x].x;}modify(1,1,tot,l[now],r[now],y - e[x].w);e[x].w = y;ans = s[1].abc;4 行未改动41 行未改动4243444546474849506 行未改动57585960616263646549 行未改动1151161171181191201211221234 行未改动41 行未改动continue;}dis[y] = dis[x] + w;dfs(y,x);dfn[++tot] = x;}r[x] = tot;}void up(int x){6 行未改动void build(int x,int l,int r){if(l == r){int now = dis[dfn[l]];s[x] = {now,now,-now,-now,0};return ;}build(ls,l,mid);build(rs,mid + 1,r);up(x);49 行未改动int now;if(dep[e[x].x] < dep[e[x].y]){now = e[x].y;}else{now = e[x].x;}modify(1,1,tot,l[now],r[now],y - e[x].w);e[x].w = y;ans = s[1].abc;4 行未改动