이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*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
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |