# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
844485 | konber | XORanges (eJOI19_xoranges) | C++14 | 1018 ms | 3724 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 <iostream>
#include <vector>
using namespace std;
int main()
{
int N, Q;
scanf("%d%d", &N, &Q);
vector<int> a(N+1);
for(int i=1; i <= N; i++)
scanf("%d", &a[i]);
while(Q--){
int q, i, j;
scanf("%d%d%d", &q, &i, &j);
if(q==1){
a[i] = j;
}
else{
int ans=0;
for(int k=i; k <= j; k++){
int pl = (k-i+1)*(j-k+1);
if(pl%2==1) ans ^= a[k];
}
printf("%d\n", ans);
}
}
}
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... |