# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
235982 | Bilyana | Wall (IOI14_wall) | C++17 | 0 ms | 0 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 "grader.h"
#define f first
#define s second
using namespace std;
const int MAXA = 1e6;
vector<pair<int, int>> st;
vector<pair<int, int>> lp;
void updateLazy(int curr, bool leaf, int pos) {
if (leaf) {
st[pos].f = max(st[pos].f, min(lp[curr].f, st[pos].s));
st[pos].s = min(lp[pos].s, max(lp[curr].s, lp[pos].f));
return;
}
lp[curr*2].f = max(lp[curr*2].f, min(lp[curr].f, lp[curr*2].s));
lp[curr*2].s = min(lp[curr*2].s, max(lp[curr].s, lp[curr*2].f));
lp[curr*2+1].f = max(lp[curr*2+1].f, min(lp[curr].f, lp[curr*2+1].s));
lp[curr*2+1].s = min(lp[curr*2+1].s, max(lp[curr].s, lp[curr*2+1].f));
lp[curr] = {0, MAXA};
}
void update(int curr, int l, int r, int b, int e, int val, int type) {
updateLazy(curr, l==r, l);
if (l > e || r < b) {
return;
}