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;
long long int arr[1000010];
int main(){
long long int n, q, i, j, k, a, b, c, x, d;
cin>>n>>q;
for(i=1; i<=n; i++){
cin>>arr[i];
}
for(i=0; i<q; i++){
cin>>a>>b>>c;
if(a==1){
arr[b]=c;
}
else{
x=0;
// for(j=b+1; j<=c; j++){
// x=x^arr[j];
// }
//cout<<x<<endl;
for(j=b; j<=c; j++){
d=0;
for(k=j; k<=c; k++){
d=d^arr[k];
x=x^d;
}
}
cout<<x<<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... |