#include <bits/stdc++.h>
#include "wall.h"
using namespace std;
//subtask 1
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
for(int i=0;i<n;i++)finalHeight[i]=0;
for(int i=0;i<k;i++){
int l=left[i],r=right[i],h=height[i],o=op[i];
for(int j=l;j<=r;j++)
if(o==1)finalHeight[j] = max(h,finalHeight[j]);
else finalHeight[j] = min(h,finalHeight[j]);
}
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
20 ms |
632 KB |
Output is correct |
5 |
Correct |
20 ms |
640 KB |
Output is correct |
6 |
Correct |
20 ms |
640 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
165 ms |
13944 KB |
Output is correct |
3 |
Correct |
1236 ms |
7496 KB |
Output is correct |
4 |
Execution timed out |
3073 ms |
18296 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
24 ms |
632 KB |
Output is correct |
5 |
Correct |
20 ms |
640 KB |
Output is correct |
6 |
Correct |
20 ms |
640 KB |
Output is correct |
7 |
Correct |
0 ms |
256 KB |
Output is correct |
8 |
Correct |
173 ms |
14036 KB |
Output is correct |
9 |
Correct |
1253 ms |
7576 KB |
Output is correct |
10 |
Execution timed out |
3072 ms |
18168 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
19 ms |
640 KB |
Output is correct |
5 |
Correct |
19 ms |
632 KB |
Output is correct |
6 |
Correct |
22 ms |
632 KB |
Output is correct |
7 |
Correct |
0 ms |
384 KB |
Output is correct |
8 |
Correct |
164 ms |
13968 KB |
Output is correct |
9 |
Correct |
1227 ms |
7516 KB |
Output is correct |
10 |
Execution timed out |
3077 ms |
18296 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |