# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
287080 |
2020-08-31T11:35:17 Z |
Atill83 |
벽 (IOI14_wall) |
C++14 |
|
3000 ms |
83160 KB |
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
const int MAXN = (int) 2e6 + 5;
typedef pair<int, int> pii;
vector<int> yer[MAXN];
set<int> st;
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++){
yer[left[i]].push_back(i + 1);
yer[right[i] + 1].push_back(-(i + 1));
}
for(int i = 0; i < n; i++){
if(yer[i].size() == 0){
if(i == 0)
finalHeight[i] = 0;
else
finalHeight[i] = finalHeight[i - 1];
}
for(int j: yer[i]){
if(j < 0) st.erase(-(j + 1));
else st.insert(j - 1);
}
int cur = 0;
for(int j: st){
if(op[j] == 1)
cur = max(cur, height[j]);
else
cur = min(cur, height[j]);
}
finalHeight[i] = cur;
}
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
34 ms |
47356 KB |
Output is correct |
2 |
Correct |
35 ms |
47736 KB |
Output is correct |
3 |
Correct |
36 ms |
47352 KB |
Output is correct |
4 |
Correct |
242 ms |
47864 KB |
Output is correct |
5 |
Correct |
170 ms |
47864 KB |
Output is correct |
6 |
Correct |
178 ms |
47864 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
47232 KB |
Output is correct |
2 |
Correct |
336 ms |
83032 KB |
Output is correct |
3 |
Execution timed out |
3084 ms |
57132 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
47232 KB |
Output is correct |
2 |
Correct |
35 ms |
47736 KB |
Output is correct |
3 |
Correct |
36 ms |
47360 KB |
Output is correct |
4 |
Correct |
239 ms |
47864 KB |
Output is correct |
5 |
Correct |
166 ms |
47992 KB |
Output is correct |
6 |
Correct |
168 ms |
47864 KB |
Output is correct |
7 |
Correct |
32 ms |
47224 KB |
Output is correct |
8 |
Correct |
330 ms |
83160 KB |
Output is correct |
9 |
Execution timed out |
3033 ms |
56824 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
47224 KB |
Output is correct |
2 |
Correct |
34 ms |
47736 KB |
Output is correct |
3 |
Correct |
36 ms |
47352 KB |
Output is correct |
4 |
Correct |
238 ms |
47844 KB |
Output is correct |
5 |
Correct |
169 ms |
47864 KB |
Output is correct |
6 |
Correct |
169 ms |
47864 KB |
Output is correct |
7 |
Correct |
32 ms |
47232 KB |
Output is correct |
8 |
Correct |
341 ms |
83032 KB |
Output is correct |
9 |
Execution timed out |
3083 ms |
56816 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |