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;
/*
John Watson
https://codeforces.com/profile/quangminh98
Mua Code nhu mua Florentino !!
*/
#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
const int maxn = 2e6 + 9;
int n, k;
int arr[maxn];
void buildWall(int _n, int _k, int op[], int left[], int right[], int height[], int finalHeight[])
{
n = _n;
k = _k;
for (int i = 0; i < k; i++)
{
int limit = height[i];
int l = left[i], r = right[i];
if (op[i] == 1)
{
for (int i = l; i <= r; i++)
if (arr[i] < limit)
arr[i] = limit;
} else
{
for (int i = l; i <= r; i++)
if (arr[i] > limit)
arr[i] = limit;
}
}
for (int i = 0; i < n; i++)
finalHeight[i] = arr[i];
}
# | 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... |