正文
增加 5 行删除 5 行
28 行未改动293031323334353637328 行未改动全部展开3663673683693703713723733743 行未改动3783793803813823833843853866 行未改动39339439539639739839940040113 行未改动41541641741841942042142242315 行未改动28 行未改动2 4 33 5 43 4 34 5 6ans:11```328 行未改动全部展开while(top[x] != top[y]){if(dep[top[x]] < dep[top[y]]) swap(x, y);node p = qry(1, dfn[top[x]], dfn[x]);if(Val.fir == -INF) Val = p;else{if(Val.fir == p.fir) Val.sec = max(Val.sec, p.sec);3 行未改动x = fa[top[x]];}if(dep[x] > dep[y]) swap(x, y);node p = qry(1, dfn[x] + 1, dfn[y]);if(Val.fir == -INF) Val = p;else{if(Val.fir == p.fir) Val.sec = max(Val.sec, p.sec);6 行未改动signed main(){n = read(), m = read();for(reg int i = 1;i <= m;i = -~i) link[i] = {read(), read(), read(), 0};sort(link + 1, link + m + 1, Sort);for(reg int i = 1;i <= n;i = -~i) fa[i] = i, sze[i] = 1;for(reg int i = 1;i <= m;i = -~i){13 行未改动}// ------------------------ Kruscalmemset(fa, 0, sizeof fa);memset(sze, 0, sizeof sze); // pre for chainget_son(1 , 1);get_chain(1, 1);build(1, 1, n);15 行未改动28 行未改动293031323334353637328 行未改动全部展开3663673683693703713723733743 行未改动3783793803813823833843853866 行未改动39339439539639739839940040113 行未改动41541641741841942042142242315 行未改动28 行未改动2 4 33 5 43 4 34 5 6ans:11```328 行未改动全部展开while(top[x] != top[y]){if(dep[top[x]] < dep[top[y]]) swap(x, y);node p = qry(1, dfn[top[x]], dfn[x]);if(Val.fir == -INF) Val = p;else{if(Val.fir == p.fir) Val.sec = max(Val.sec, p.sec);3 行未改动x = fa[top[x]];}if(dep[x] > dep[y]) swap(x, y);node p = qry(1, dfn[x] + 1, dfn[y]);if(Val.fir == -INF) Val = p;else{if(Val.fir == p.fir) Val.sec = max(Val.sec, p.sec);6 行未改动signed main(){n = read(), m = read();for(reg int i = 1;i <= m;i = -~i) link[i] = {read(), read(), read(), 0};sort(link + 1, link + m + 1, Sort);for(reg int i = 1;i <= n;i = -~i) fa[i] = i, sze[i] = 1;for(reg int i = 1;i <= m;i = -~i){13 行未改动}// ------------------------ Kruscalmemset(fa, 0, sizeof fa);memset(sze, 0, sizeof sze); // pre for chainget_son(1 , 1);get_chain(1, 1);build(1, 1, n);15 行未改动