rt
#include<bits/stdc++.h>
using namespace std;
int v[1000],pos[1000],next[1000];
int main(){
int q,op,x,y,num=0;
cin>>q;
next[0]=1;
v[1]=1;
pos[1]=1;
while(q--){
int op;
cin>>op;
if(op==1){
cin>>x>>y;
if(!pos[x]) pos[x]=num++,v[pos[x]]=x;
if(!pos[y]) pos[y]=num++,v[pos[y]]=y;
next[pos[y]]=next[pos[x]];
next[pos[x]]=pos[y];
}
else if(op==2){
cin>>x;
cout<<v[next[pos[x]]]<<endl;
}
else{
next[pos[x]]=next[next[pos[x]]];
}
}
return 0;
}
在本地C++上报错,报错信息为:
[Error]reference to'next' is ambiguous
中文意思(貌似):【错误】'next'是摸棱两可的参考/查阅
???