# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642530 | Urvuk3 | XORanges (eJOI19_xoranges) | C++17 | 13 ms | 1996 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>
#include <chrono>
#define ll long long
#define ull unsigned long long
#define ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define inf 1e15
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
using namespace std::chrono;
const int maxn = 1e5+1;
int a[maxn];
int main(){
int n,q;
scanf("%d %d",&n,&q);
for(int i = 0;i<n;i++){
scanf("%d",&a[i]);
}
int qu;
int l,u;
int ans;
while(q--){
cin >> qu>> l >> u;
if(qu==1){
a[l-1]=u;
}else{
ans = 0;
if((u-l+1)%2==0){
printf("0\n");
}else{
for(int i = l-1;i<=u-1;i+=2){
ans^=a[i];
}
printf("%lld\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... |