20pts求调
查看原帖
20pts求调
1367086
zzhhyy1234楼主2024/8/19 15:11
#include<bits/stdc++.h>
using namespace std; 
int nex[1000006],n,a,x,y;
int main(){
	cin>>n;
	while(n--){
		cin>>a>>x;
		if(a==1) cin>>y,nex[y]=nex[x],nex[x]=y;
		else if(a==2) cout<<nex[x]<<endl;
		else nex[x]=nex[y];
	}
	return 0;
}
2024/8/19 15:11
加载中...