# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427354 | illyakr | Wall (IOI14_wall) | C++14 | 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 "wall.h"
using namespace std;
struct Info {
int add = -1;
int del = -1;
int press = -1;
int have = -1;
};
int t[8000001];
Info tAdd[8000001];
void push(int v, int vl, int vr) {
if (tAdd[v].have == -1)return;
tAdd[v].add = -1;
tAdd[v].del = -1;
tAdd[v].press = -1;
tAdd[v].have = -1;
}
void upd(int v, int vl, int vr, int l, int r, int val) {
push(v, vl, vr);
if (l <= vl && vr <= r) {
push(v, vl, vr);
return;
}
if (r < vl || vr < l)return;
int vm = (vl + vr) / 2;
upd(2 * v, vl, vm, l, r, val);
upd(2 * v + 1, vm + 1, vr, l, r, val);
}
int gt(int v, int vl, int vr, int pos) {
push(v, vl, vr);
if (vl == vr)return t[v];
int vm = (vl + vr) / 2;
if (pos <= vm)return gt(2 * v, vl, vm, pos);
return gt(2 * v + 1, vm + 1, vr, pos);
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
}
/**
-1 -1
10 6
1 1 8 4
2 4 9 1
2 3 6 5
1 0 5 3
1 2 2 5
2 6 7 0
*/