# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
516714 | pavement | 벽 (IOI14_wall) | C++17 | 743 ms | 231340 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 <bits/stdc++.h>
using namespace std;
int res[2000005];
struct node {
node *left, *right;
int S, E, lo, hi;
node(int _s, int _e) : S(_s), E(_e), lo(0), hi(100000) {
if (S == E) return;
int M = (S + E) >> 1;
left = new node(S, M);
right = new node(M + 1, E);
}
void s_upd(int v, int ty) {
if (ty == 1) {
if (v > hi) lo = hi = v;
else lo = max(lo, v);
} else {
if (v < lo) lo = hi = v;
else hi = min(hi, v);
}
}
void prop() {
if (S == E) return;
left->s_upd(lo, 1);
left->s_upd(hi, 2);
right->s_upd(lo, 1);
right->s_upd(hi, 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... |