| 比赛 | 20211014 | 评测结果 | AAATTTTTTA |
|---|---|---|---|
| 题目名称 | 平凡的测试数据 | 最终得分 | 40 |
| 用户昵称 | 00000 | 运行时间 | 6.000 s |
| 代码语言 | C++ | 内存使用 | 5.73 MiB |
| 提交时间 | 2021-10-14 20:54:28 | ||
#include<bits/stdc++.h>
using namespace std;
int n,m,a[500005],b[500005],v,z,x;
int main(){
freopen("td.in","r",stdin);
freopen("td.out","w",stdout);
cin>>n>>m;
for(int q=1;q<=n;q++)
{
cin>>a[q];b[q]=q;
}
for(int q=1;q<=m;q++)
{
cin>>v;
if(v==1)
{
cin>>z>>x;
b[z]=x;
}else
{
cin>>x;z=0;
while(b[x]!=x)
{
z=z^a[x];x=b[x];
}
z=z^a[x];
cout<<z<<endl;
}
}
return 0;
}