正文
增加 5 行删除 5 行
89 行未改动90919293949596979855 行未改动15415515615715815916016116247 行未改动2102112122132142152162172187 行未改动22622722822923023123223323421 行未改动25625725825926026126226326465 行未改动89 行未改动if(t==fa) continue;cnt+=sf[t];if(sf[t]) p=t;}if(cnt>1) wc=1;if(cnt==1) {if(b[u]==a[p]) {++ans;rdfs(p,u);55 行未改动dfs1(rt,0);for(int i=1;i<=n;++i) {A[i]=a[i];}// if(chk()) {// for(auto t:ls) {// cout<<t<<" ";// } puts("");// }47 行未改动// cout<<st[i]<<" "<<en[i]<<endl;}// if(chk()) cout<<114514<<' ';if(cnt==2) {if(Fa[en[0]]!=Fa[en[1]]) {//两条链不是一个父亲Fail();}}// if(chk()) cout<<114514<<" ";7 行未改动// cout<<11451499<<":";// }}else {for(int j=cn[i].size()-1;j>=0;--j) {int t=cn[i][j];// if(chk()&&t==195029) {// cout<<1145149<<":";21 行未改动// for(auto t:C) {// cout<<t<<' ';// }// }for(int i=pp,len=C.size();i<len;++i) {//判断是不是一个轮换int t=C[i];if(t!=B[tot]) Fail();++tot;}65 行未改动89 行未改动90919293949596979855 行未改动15415515615715815916016116247 行未改动2102112122132142152162172187 行未改动22622722822923023123223323421 行未改动25625725825926026126226326465 行未改动89 行未改动if(t==fa) continue;cnt+=sf[t];if(sf[t]) p=t;}if(cnt>1) wc=1;if(cnt==1) {if(b[u]==a[p]) {++ans;rdfs(p,u);55 行未改动dfs1(rt,0);for(int i=1;i<=n;++i) {A[i]=a[i];}// if(chk()) {// for(auto t:ls) {// cout<<t<<" ";// } puts("");// }47 行未改动// cout<<st[i]<<" "<<en[i]<<endl;}// if(chk()) cout<<114514<<' ';if(cnt==2) {if(Fa[en[0]]!=Fa[en[1]]) {//两条链不是一个父亲Fail();}}// if(chk()) cout<<114514<<" ";7 行未改动// cout<<11451499<<":";// }}else {for(int j=cn[i].size()-1;j>=0;--j) {int t=cn[i][j];// if(chk()&&t==195029) {// cout<<1145149<<":";21 行未改动// for(auto t:C) {// cout<<t<<' ';// }// }for(int i=pp,len=C.size();i<len;++i) {//判断是不是一个轮换int t=C[i];if(t!=B[tot]) Fail();++tot;}65 行未改动