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;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, q; cin >> n >> q;
vector <int> a(n);
for ( auto &u: a ) cin >> u;
while ( q-- ){
int t, l, u; cin >> t >> l >> u;
if ( t == 1 ){
a[l - 1] = u;
} else{
l--, u--;
if ( (u - l) & 1 ){
cout << "0\n";
continue;
}
int ans = 0;
for ( int i = l; i <= u; i++ ){
if ( (i - l + 1) & 1 ) ans ^= a[i];
}
cout << ans << '\n';
}
}
cout << '\n';
}
# | 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... |