This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,fen[100009][2],tes,t,tp,f[200009];
void upd(int q, int w, int rr){
while(q<=100000){
fen[q][w]^=rr;
q=q+(q&(-q));
}
}
int read(int q, int w){
int jm=0;
while(q>=1){
jm^=fen[q][w];
q=q-(q&(-q));
}
return jm;
}
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a>>tes;
for(i=1; i<=a; i++){
cin>>f[i];
upd(i/2+i%2,i%2,f[i]);
}
for(t=1; t<=tes; t++){
cin>>tp>>c>>d;
if(tp==1){
upd(c/2+c%2,c%2,(f[c]^d));
f[c]=d;
}else{
if((d-c+1)%2==0){
cout<<0<<endl;
continue;
}
e=c%2;
c-=2;
cout<<(read(d/2+d%2,e)^read(c/2+c%2,e))<<endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |