# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
657821 | cpp219 | XORanges (eJOI19_xoranges) | C++17 | 191 ms | 11248 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 ll int
#define ld double
#define fs first
#define sc second
#define debug(y) cout<<y,exit(0)
using namespace std;
typedef pair<ll,ll> LL;
const ll N = 2e5 + 9;
const ll mod = 1e9 + 7;
ll n,q,a[N];
ll st[4*N][2];
void upd(ll id,ll type,ll l,ll r,ll u,ll val){
if (u < l||r < u) return;
if (l == r){
st[id][type] ^= val; return;
}
ll mid = (l + r)/2;
upd(id*2,type,l,mid,u,val);
upd(id*2 + 1,type,mid + 1,r,u,val);
st[id][type] = st[id*2][type] ^ st[id*2 + 1][type];
}
ll Get(ll id,ll type,ll l,ll r,ll u,ll v){
if (v < l||r < u) return 0;
if (u <= l&&r <= v) return st[id][type];
ll mid = (l + r)/2;
return Get(id*2,type,l,mid,u,v) ^ Get(id*2 + 1,type,mid + 1,r,u,v);
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... |