# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
973403 | colossal_pepe | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++17 | 1254 ms | 106264 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |