# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331846 | keko37 | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 2301 ms | 95748 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 MAXN = 1000005;
const int INF = 1000000007;
int n, m, ofs = 1;
int w[MAXN], lef[MAXN], rig[MAXN], mood[MAXN], ans[MAXN];
int t[MAXN * 4], mx[MAXN * 4];
vector <int> v[MAXN], r;
void build () {
for (int i = 0; i < 2 * ofs; i++) mx[i] = -INF;
for (int i = 0; i < n; i++) mx[i + ofs] = w[i];
for (int i = ofs - 1; i > 0; i--) {
mx[i] = max(mx[2 * i], mx[2 * i + 1]);
}
}
void update (int pos, int val) {
pos += ofs;
t[pos] = val;
pos /= 2;
while (pos > 0) {
t[pos] = max(t[pos * 2], t[pos * 2 + 1]);
pos /= 2;
}
}
# | 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... |