# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122831 | turbat | 벽 (IOI14_wall) | C++14 | 803 ms | 82100 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>
#include "wall.h"
using namespace std;
#define N 2000005
int lim[4 * N], seg[4 * N], h[N];
void clear(int nd){
seg[nd * 2] = max(seg[nd * 2], min(lim[nd * 2], seg[nd]));
seg[nd * 2 + 1] = max(seg[nd * 2 + 1], min(lim[nd * 2 + 1], seg[nd]));
lim[nd * 2] = min(lim[nd * 2], lim[nd]);
lim[nd * 2 + 1] = min(lim[nd * 2 + 1], lim[nd]);
}
void update(int nd, int L, int R, int l, int r, int h, int t){
// cout << nd << ' '<< L << ' ' << R<< endl;
if (r < L || R < l) return;
if (t == 1) h = min(h, lim[nd]);
if (l <= L && R <= r){
if (t == 1) seg[nd] = max(seg[nd], h);
else lim[nd] = min(h, lim[nd]);
return;
}
clear(nd);
update(nd * 2, L, (L + R) / 2, l, r, h, t);
update(nd * 2 + 1, (L + R) / 2 + 1, R, l, r, h, t);
}
void end(int nd, int l, int r){
if (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... |