#include <bits/stdc++.h>
using namespace std;
void buildWall(int n, int k, int op[],int left[],int right[],int heights[],int finalHeight[]) {
for (int i = 0; i < n; i++)
{
finalHeight[i] = 0;
}
for (int i = 0; i < k; i++)
{
if (op[i] == 1)
{
for (int j = left[i]; j <= right[i]; j++)
{
finalHeight[j] = max(finalHeight[j], heights[i]);
}
}
else
{
for (int j = left[i]; j <= right[i]; j++)
{
finalHeight[j] = min(finalHeight[j], heights[i]);
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
20 ms |
572 KB |
Output is correct |
5 |
Correct |
20 ms |
640 KB |
Output is correct |
6 |
Correct |
20 ms |
768 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
179 ms |
14072 KB |
Output is correct |
3 |
Correct |
1297 ms |
7544 KB |
Output is correct |
4 |
Execution timed out |
3057 ms |
18312 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
20 ms |
640 KB |
Output is correct |
5 |
Correct |
20 ms |
640 KB |
Output is correct |
6 |
Correct |
20 ms |
640 KB |
Output is correct |
7 |
Correct |
1 ms |
256 KB |
Output is correct |
8 |
Correct |
173 ms |
14004 KB |
Output is correct |
9 |
Correct |
1294 ms |
7544 KB |
Output is correct |
10 |
Execution timed out |
3080 ms |
18168 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
640 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
20 ms |
640 KB |
Output is correct |
5 |
Correct |
20 ms |
632 KB |
Output is correct |
6 |
Correct |
20 ms |
760 KB |
Output is correct |
7 |
Correct |
1 ms |
256 KB |
Output is correct |
8 |
Correct |
187 ms |
13944 KB |
Output is correct |
9 |
Correct |
1309 ms |
7544 KB |
Output is correct |
10 |
Execution timed out |
3071 ms |
18112 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |