# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
30909 | h0ngjun7 | Wall (IOI14_wall) | C++14 | 966 ms | 87072 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 "wall.h"
#include <algorithm>
using namespace std;
const int MAXN = 2000005;
struct SEG {
int max, min;
} seg[4 * MAXN];
int n;
void push(int x) {
int L = x * 2, R = x * 2 + 1;
seg[L].min = min(max(seg[L].min, seg[x].min), seg[x].max);
seg[R].min = min(max(seg[R].min, seg[x].min), seg[x].max);
seg[L].max = max(min(seg[L].max, seg[x].max), seg[x].min);
seg[R].max = max(min(seg[R].max, seg[x].max), seg[x].min);
}
void query(int x, int s, int e, int l, int r, int h, int op) {
if (s > e) return;
if (e < l || r < s) return;
if (l <= s && e <= r) {
if (op == 1) {
seg[x].min = max(seg[x].min, h);
seg[x].max = max(seg[x].max, h);
}
else {
seg[x].max = min(seg[x].max, h);
# | 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... |