# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
816875 | acatmeowmeow | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++11 | 1210 ms | 91128 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 int long long
const int N = 1e6;
int n, m, arr[N + 5];
struct info {
int res = 0, mx = 0, mn = 1e18;
info operator+(info x) {
info ans;
ans.res = mx > x.mn ? mx + x.mn : 0;
ans.mx = max(mx, x.mx);
ans.mn = min(mn, x.mn);
return ans;
}
};
info tree[4*N + 5];
void update(int v, int tl, int tr, int k, int x) {
if (tl == tr) tree[v].mx = tree[v].mn = x;
else {
int tm = (tl + tr)/2;
if (k <= tm) update(v*2, tl, tm, k, x);
else update(v*2 + 1, tm + 1, tr, k, x);
tree[v] = tree[v*2] + tree[v*2 + 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |