# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
447577 | MrDeboo | XORanges (eJOI19_xoranges) | C++17 | 180 ms | 13568 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>
#define endl '\n'
#define int long long
#define mod 1000000007
#define INF 1000000000000000000
using namespace std;
int seg1[600000];
int seg2[600000];
int N,a,b,c;
int solve1(int l=1,int r=N,int in=1){
if(r<b||c<l)return 0;
if(l>=b&&r<=c)return seg1[in];
int mid=(l+r)/2;
return solve1(l,mid,in*2)^solve1(mid+1,r,in*2+1);
}
int solve2(int l=1,int r=N,int in=1){
if(r<b||c<l)return 0;
if(l>=b&&r<=c)return seg2[in];
int mid=(l+r)/2;
return solve2(l,mid,in*2)^solve2(mid+1,r,in*2+1);
}
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//freopen("tttt.in", "r", stdin);
//freopen("tttt.out", "w", stdout);
int n,q;
cin>>n>>q;
N=exp2(ceil(log2(n)));
for(int i=0;i<n;i++){
if(i&1)cin>>seg1[i+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... |