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() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, q;
cin >> n >> q;
int a[n + 1];
for(int i = 1; i <= n; i++) {
cin >> a[i];
}
while(q--) {
int t, l, r;
cin >> t >> l >> r;
if(t == 1) {
a[l] = r;
} else {
int S = a[l];
for(int i = l + 1; i <= r; i++) {
S = (S ^ a[i]);
}
for(int i = 2; i <= r - l + 1; i++) {
for(int j = l; j <= r - i + 1; j++) {
int A = 0;
for(int k = j; k <= j + i - 1; k++) {
A = (A ^ a[k]);
}
S = (S ^ A);
}
}
cout << S << '\n';
}
}
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... |