# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
307575 | Mounir | XORanges (eJOI19_xoranges) | C++14 | 122 ms | 6112 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 int long long
#define chmin(x, v) x = min(x, v)
#define chmax(x, v) x = max(x, v)
#define all(v) v.begin(), v.end()
using namespace std;
const int N = (1 << 17);
int tXor[2][N * 2];
int getXor(int ind, int gauche, int droite){
if (droite < gauche) return 0;
if (gauche%2 == 1) return tXor[ind][gauche]^getXor(ind, gauche + 1, droite);
if (droite%2 == 0) return tXor[ind][droite]^getXor(ind, gauche, droite - 1);
return getXor(ind, gauche/2, droite/2);
}
void actualiser(int ind, int noeud, int val){
tXor[ind][noeud] = val; noeud /= 2;
for (; noeud > 0; noeud /= 2) tXor[ind][noeud] = tXor[ind][noeud * 2]^tXor[ind][noeud * 2 + 1];
}
signed main(){
int nVals, nReqs; cin >> nVals >> nReqs;
for (int iVal = 0; iVal < nVals; ++iVal){
int val; cin >> val;
actualiser(iVal%2, N + iVal, val);
}
while (nReqs--){
# | 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... |