이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000000;
vector<int> arr;
void update(int l, int r, int h, int type){
for(int i = l; i <= r; i++){
if(type == 1)
arr[i] = max(arr[i], h);
else
arr[i] = min(arr[i], h);
}
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
arr.assign(n, 0);
for(int i = 0; i < k; i++){
int type = op[i];
int l = left[i], r = right[i], h = height[i];
if(type == 1)
update(l, r, h, 1);
else
update(l,r,h,2);
}
for(int i = 0; i < n; i++){
//cout<<arr[i]<<" ";
finalHeight[i] = arr[i];
}
}
/*int main()
{
int n, k;
cin>>n>>k;
int op[k], left[k], right[k], height[k], finalHeight[n];
for(int i = 0; i <k; i++){
cin>>op[i]>>left[i]>>right[i]>>height[i];
}
buildWall(n, k, op, left, right, height, finalHeight);
}*/
# | 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... |