이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
int N, Q, ty[1 << 21], L[1 << 21], R[1 << 21], H[1 << 21], A[1 << 21];
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
N = n; Q = k;
for (int i = 1; i <= Q; i++) { ty[i] = op[i - 1]; L[i] = left[i - 1]; R[i] = right[i - 1]; H[i] = height[i - 1]; }
for (int i = 1; i <= Q; i++) {
if (ty[i] == 1) {
for (int j = L[i]; j <= R[i]; j++) A[j] = max(A[j], H[i]);
}
if (ty[i] == 2) {
for (int j = L[i]; j <= R[i]; j++) A[j] = min(A[j], H[i]);
}
}
for (int i = 0; i < N; i++) finalHeight[i] = A[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... |