# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976820 | Isam | XORanges (eJOI19_xoranges) | C++17 | 1064 ms | 3924 KiB |
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;
constexpr int sz = 2e5 + 5;
int n, q, a[sz];
signed main(){
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> n >> q;
for(register int i = 1; i <= n; ++i){
cin >> a[i];
}
int type, l, r;
while(q--){
cin >> type >> l >> r;
if(type == 1){
a[l] = r;
}else{
int ans(0);
for(register int i = l; i <= r; ++i){
int x = ((i - l + 1) & 1) * ((r - i + 1) & 1);
if(x & 1) ans ^= a[i];
}
cout << ans << '\n';
}
}
}
Compilation message (stderr)
# | 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... |