| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 733533 | Julto | 벽 (IOI14_wall) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
for(int i = 0; i < k; i++){
for(int j = left[i]; j <= right[i]; j++){
if(op[i] == 1){
finalHeight[j] = max(height[i], finalHeight[j]);
}
else{
finalHeight[j] = min(height[i], finalHeight[j]);
}
}
}
/*for(int i = 0; i < n; i++){
cout << finalHeight[i] << " ";
}*/
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, k; n = 4, k = 5;
int left[] = {0, 1, 1, 0, 2}, right[] = {3, 2, 1, 1, 3},
height[] = {2, 1, 3, 4, 10}, op[] = {1, 2, 1, 2, 1}, finalHeight[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
buildWall(n, k, op, left, right, height, finalHeight);
}
