# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
338522 | shivensinha4 | Birthday gift (IZhO18_treearray) | C++17 | 0 ms | 364 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"
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define endl '\n'
class SparseTable {
vector<vector<ii>> st;
vi log; vector<ii> raw;
int n;
void computeLog() {
log.resize(n+1, -1);
int p = 0, two_pow = 1;
while (two_pow <= n) {
log[two_pow] = p++;
two_pow *= 2;
}
int prev = 0;
for_(i, 1, n+1) {
if (log[i] != -1) prev = log[i];
else log[i] = prev;
}
}
void buildTable() {
int k = log[n]+1;
# | 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... |