# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1160780 | hackstar | Wall (IOI14_wall) | C++20 | 0 ms | 0 KiB |
#pragma GCC optimize("Ofast,O3,unroll-loops")
#pragma GCC target("avx,avx2")
//#pragma GCC target("bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
const int N = 200005;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
typedef __gnu_pbds::tree<int, __gnu_pbds::null_type, less<int>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update> ordered_set;
template<typename T> vector<T> &operator--(vector<T> &v) {for (auto &i: v) --i;return v;}
template<typename T> vector<T> &operator++(vector<T> &v) {for (auto &i: v) ++i;return v;}
template<typename T>istream &operator>>(istream &is, vector<T> &v) {for (auto &i: v) is >> i;return is;}
template<typename T>ostream &operator<<(ostream &os, vector<T> &v) {for (auto &i: v) os << i << ' ';return os;}
template<typename T, typename U>istream &operator>>(istream &is, pair<T, U> &p) {is >> p.first >> p.second;return is;}
template<typename T, typename U>ostream &operator<<(ostream &os, pair<T, U> &p) {os << p.first << ' ' << p.second;return os;}
template<typename T, typename U> pair<T, U> operator-(pair<T, U> a, pair<T, U> b) { return mp(a.first - b.first, a.second - b.second); }
template<typename T, typename U> pair<T, U> operator+(pair<T, U> a, pair<T, U> b) { return mp(a.first + b.first, a.second + b.second); }
template<typename T, typename U> void umin(T &a, U b) { if (a > b) a = b; }
template<typename T, typename U> void umax(T &a, U b) { if (a < b) a = b; }
void solve() {
int n,m;
cin >> n >> m;
vector<int> a(n,0);
// cin >> a;
while(m--) {
int mode,l,r,x;
cin >> mode >> l >> r >> x;
if(mode == 1) {
for(int i = l - 1;i < r;++i) {
if(a[i] > x) a[i]=x;
}
}
else {
for(int i = l - 1;i < r;++i) {
if(a[i] < x) a[i]=x;
}
}
}
for(int i=0;i<n;i++){
cout<<a[i]<<'\n';
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1;
// cint
while (t--) solve();
}