# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
253391 | ChrisT | Wall (IOI14_wall) | C++17 | 757 ms | 110268 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;
const int MN = 2e6+5;
#define lc ind<<1
#define rc ind<<1|1
struct Node {
int l,r,mx,mn;
} tree[MN<<2];
int ans[MN];
int le[MN], ri[MN], o[MN], he[MN], f[MN];
void build (int ind, int l, int r) {
tree[ind] = {l,r,0,INT_MAX};
if (l == r) return;
int mid = (l+r)>>1;
build(lc,l,mid), build(rc,mid+1,r);
}
void remove (int ind, int v) {
tree[ind].mn = min(tree[ind].mn,v);
tree[ind].mx = min(tree[ind].mx,v);
}
void add (int ind, int v) {
tree[ind].mx = max(tree[ind].mx,v);
tree[ind].mn = max(tree[ind].mn,v);
}
void push_down (int ind) {
if (tree[ind].l == tree[ind].r) return;
add(lc,tree[ind].mx);
remove(lc,tree[ind].mn);
add(rc,tree[ind].mx);
# | 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... |