# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
492655 | boykut | 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>
using namespace std;
#define UNDEFADD 0
template <typename T>
class segment_tree {
public:
segment_tree() {}
segment_tree(int k) {
n = 1; while (n < k) n <<= 1;
t = vector<node> (2 * n - 1);
}
private:
struct node {
int min, max;
};
int n;
vector<node> t;
};
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, t;
cin >> n >> t;
vector<int> a(n, 0);
while (t --) {
int o, l, r, h;
cin >> o >> l >> r >> h;
for (int i = l; i <= r; i++) {
if (o == 1) a[i] = max(a[i], h);
else a[i] = min(a[i], h);
}
}
for (int i = 0; i < n; i++) {
cout << a[i] << '\n';
}
return 0;
}