版本比较
线段树合并学习笔记
正文
增加 1 行删除 1 行
157 行未改动全部展开15815916016116216216316416516626 行未改动157 行未改动全部展开}void dfs(int x){ for(int i:edge[x]){ if(i==chan[x].f)continue; dfs(i); dfs(i); merge(1,N,root[x],root[i]); } ans[x]=max(tree[root[x]].v,{0,0}).p; return;26 行未改动