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 main () {
int n, q;
cin >> n >> q;
vector<int> v(n, 0);
for(int i = 0;i<n;i++) {
int p;
cin >> p;
v[i] = p;
}
while(q--) {
int k;
cin >> k;
if(k == 2) {
int s = 0;
int l, u;
cin >> l >> u;
l--;
u = min(u, n);
for(int i = l;i<u;i++) {
if(((i - l + 1)*(u - i))%2)s^=v[i];
}
cout<<s<<endl;
}
else {
int i, j;
cin >> i >> j;
v[i-1] = j;
}
}
}
# | 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... |