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--;
int ans = 0;
for ( int i = l; i <= u; i++ ){
int x = (i - l + 1), y = (u - i + 1);
if ( (x * 1LL * y) & 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... |