# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
52301 | win11905 | Wall (IOI14_wall) | C++11 | 1010 ms | 239024 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;
const int N = 1<<21, INF = 1e9;
int n, lo[N<<1], hi[N<<1], *ans;
void addtag(int p, int low, int high) {
lo[p] = min(high, max(lo[p], low));
hi[p] = max(low, min(hi[p], high));
}
void push(int p, int l, int r) {
if(l == r) ans[l] = min(max(ans[r], lo[p]), hi[p]);
else {
int m = (l + r) >> 1;
addtag(p<<1, lo[p], hi[p]);
addtag(p<<1|1, lo[p], hi[p]);
}
lo[p] = 0;
hi[p] = INF;
}
void update(int x, int y, int lo, int hi, int p = 1, int l = 0, int r = n-1) {
if(x > r || l > y) return;
if(x <= l && r <= y) return addtag(p, lo, hi);
push(p, l, r);
int m = (l + r) >> 1;
update(x, y, lo, hi, p<<1, l, m), update(x, y, lo, hi, p<<1|1, m+1, r);
Compilation message (stderr)
# | 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... |