#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
using namespace std;
int a[200001];
/*int t[800001];
void build(int v,int tl,int tr){
if(tl==tr)
t[v]=a[tl];
else{
int m=(tl+tr)/2;
build(2*v,tl,m);
build(2*v+1,m+1,tr);
t[v]=t[2*v]^t[2*v+1];
}
}
int get(int v,int tl,int tr,int l,int r){
if(l==tl&&r==tr)
return t[v];
int m=(tl+tr)/2;
if(r<=m)
return get(2*v,tl,m,l,r);
else{
if(l>m)
return get(2*v+1,m+1,tr,l,r);
else{
return get(2*v,tl,m,l,m)^get(2*v+1,m+1,tr,m+1,r);
}
}
}
void update(int v,int tl,int tr,int p,int x){
if(tl==tr)
t[v]=x;
else{
int m=(tl+tr)/2;
if(p<=m)
update(2*v,tl,m,p,x);
else
update(2*v+1,m+1,tr,p,x);
t[v]=t[2*v]^t[2*v+1];
}
}*/
int main(){
int n,t;
cin>>n>>t;
for(int k=1;k<=n;k++){
cin>>a[k];
}
//build(1,1,n);
while(t--){
int aa,b,c;
cin>>aa>>b>>c;
if(aa==2){
int len=c-b+1;
if(len==1){
cout<<a[b]<<"\n";
continue;
}
if(len%2==0)
cout<<0<<"\n";
else{
cout<<(a[c]^a[b])<<"\n";
}
}
else{
a[b]=c;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
588 ms |
7044 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |