# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
733533 |
2023-05-01T02:28:05 Z |
Julto |
벽 (IOI14_wall) |
C++14 |
|
0 ms |
0 KB |
#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);
}
Compilation message
/usr/bin/ld: /tmp/ccEpYthS.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc86y3LR.o:wall.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status