# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163431 | davitmarg | 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.
/*DavitMarg*/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <stack>
#include <cassert>
#include <iterator>
#include <fstream>
#define mod 1000000007ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(), v.end()
using namespace std;
#ifndef death
#include "wall.h"
#endif
const int N = 2000006;
void buildWall(int n, int k, int op[], int L[], int R[], int H[], int fin[])
{
for (int i = 0; i < n; i++)
fin[i] = 0;
for (int j = 0; j < k; j++)
{
for (int i = L[j]]; i <= R[j]; i++)
if (op[j] == 1)
{
if (fin[i] < H[j])
fin[i] = H[j];
}
else
{
if (fin[i] > H[j])
fin[i] = H[j];
}
}
}
#ifdef death
int main()
{
int N, K, L[102], R[102], OP[102], H[102], A[102];
cin >> N >> K;
for (int i = 0; i < K; i++)
cin >> OP[i] >> L[i] >> R[i] >> H[i];
buildWall(N, K, OP, L, R, H, A);
for (int i = 0; i < N; i++)
cout << A[i] << endl;
return 0;
}
#endif
/*
10 3
1 3 4 91220
1 5 9 48623
2 3 5 39412
*/