#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) {
if (op[i] == 1) { //adding phase
for (int j = left[i]; j <= right[i]; ++j) {
finalHeight[j] = max(finalHeight[j], height[i]);
}
} else {
for (int j = left[i]; j <= right[i]; ++j) {
finalHeight[j] = min(finalHeight[j], height[i]);
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
18 ms |
468 KB |
Output is correct |
5 |
Correct |
19 ms |
500 KB |
Output is correct |
6 |
Correct |
22 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
136 ms |
13900 KB |
Output is correct |
3 |
Correct |
1160 ms |
7460 KB |
Output is correct |
4 |
Execution timed out |
3052 ms |
18128 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
3 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
308 KB |
Output is correct |
4 |
Correct |
16 ms |
512 KB |
Output is correct |
5 |
Correct |
20 ms |
476 KB |
Output is correct |
6 |
Correct |
18 ms |
504 KB |
Output is correct |
7 |
Correct |
1 ms |
304 KB |
Output is correct |
8 |
Correct |
129 ms |
13932 KB |
Output is correct |
9 |
Correct |
1113 ms |
7400 KB |
Output is correct |
10 |
Execution timed out |
3050 ms |
18032 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
19 ms |
496 KB |
Output is correct |
5 |
Correct |
18 ms |
468 KB |
Output is correct |
6 |
Correct |
18 ms |
480 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
129 ms |
13844 KB |
Output is correct |
9 |
Correct |
1149 ms |
7408 KB |
Output is correct |
10 |
Execution timed out |
3071 ms |
18124 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |