# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
222277 |
2020-04-13T01:04:15 Z |
MODDI |
벽 (IOI14_wall) |
C++14 |
|
3000 ms |
18296 KB |
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000000;
vector<int> arr;
void update(int l, int r, int h, int type){
for(int i = l; i <= r; i++){
if(type == 1)
arr[i] = max(arr[i], h);
else
arr[i] = min(arr[i], h);
}
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
arr.assign(n, 0);
for(int i = 0; i < k; i++){
int type = op[i];
int l = left[i], r = right[i], h = height[i];
if(type == 1)
update(l, r, h, 1);
else
update(l,r,h,2);
}
for(int i = 0; i < n; i++){
//cout<<arr[i]<<" ";
finalHeight[i] = arr[i];
}
}
/*int main()
{
int n, k;
cin>>n>>k;
int op[k], left[k], right[k], height[k], finalHeight[n];
for(int i = 0; i <k; i++){
cin>>op[i]>>left[i]>>right[i]>>height[i];
}
buildWall(n, k, op, left, right, height, finalHeight);
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
256 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
22 ms |
768 KB |
Output is correct |
5 |
Correct |
23 ms |
640 KB |
Output is correct |
6 |
Correct |
23 ms |
608 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
187 ms |
13944 KB |
Output is correct |
3 |
Correct |
1263 ms |
7552 KB |
Output is correct |
4 |
Execution timed out |
3076 ms |
18168 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
7 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
22 ms |
640 KB |
Output is correct |
5 |
Correct |
23 ms |
640 KB |
Output is correct |
6 |
Correct |
22 ms |
640 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
180 ms |
13944 KB |
Output is correct |
9 |
Correct |
1222 ms |
7544 KB |
Output is correct |
10 |
Execution timed out |
3077 ms |
18296 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
512 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
23 ms |
640 KB |
Output is correct |
5 |
Correct |
24 ms |
640 KB |
Output is correct |
6 |
Correct |
23 ms |
640 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
192 ms |
13944 KB |
Output is correct |
9 |
Correct |
1237 ms |
7572 KB |
Output is correct |
10 |
Execution timed out |
3084 ms |
18168 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |