# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973403 | colossal_pepe | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 1254 ms | 106264 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;
const int INF = 1e9;
struct SGT {
int n;
vector<int> tree;
SGT(int _n) {
n = _n;
tree.resize(4 * n, 0);
}
void update(int node, int l, int r, int idx, int x) {
if (l == r) tree[node] = x;
else {
int mid = (l + r) / 2;
if (idx <= mid) update(2 * node, l, mid, idx, x);
else update(2 * node + 1, mid + 1, r, idx, x);
tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
}
int query(int node, int l, int r, int L, int R) {
if (R < l or r < L) return 0;
else if (L <= l and r <= R) return tree[node];
else{
int mid = (l + r) / 2;
return max(query(2 * node, l, mid, L, R), query(2 * node + 1, mid + 1, r, L, R));
}
}
};
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |