# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
800840 |
2023-08-02T00:04:18 Z |
Liudas |
벽 (IOI14_wall) |
C++17 |
|
455 ms |
30352 KB |
#include <bits/stdc++.h>
#include "wall.h"
using namespace std;
void buildWall(int N, int K, int op[], int l[], int r[], int h[], int fh[]){
if(N <= 10000 && K <= 5000){
for(int i = 0; i < K; i ++){
for(int j = l[i]; j < r[i] + 1; j ++){
if(op[i] == 1){
fh[j] = max(h[i], fh[j]);
}
else{
fh[j] = min(h[i], fh[j]);
}
}
}
}
else{
vector<vector<int>> arr(N + 5);
for(int i = 0; i < K; i ++){
if(op[i] == 2)continue;
arr[l[i]].push_back(h[i] + 1);
arr[r[i]+1].push_back(-h[i] - 1);
}
multiset<int> mov;
mov.insert(0);
for(int i = 0; i < N; i ++){
for(int j : arr[i]){
if(j > 0)
mov.insert(j-1);
else
mov.erase(mov.find(-j - 1));
}
fh[i] = *mov.rbegin();
arr[i].clear();
}
mov.clear();
for(int i = 0; i < K; i ++){
if(op[i] == 1)continue;
arr[l[i]].push_back(h[i] + 1);
arr[r[i]+1].push_back(-h[i] - 1);
}
mov.insert(1e9);
for(int i = 0; i < N; i ++){
for(int j : arr[i]){
if(j > 0)
mov.insert(j-1);
else
mov.erase(mov.find(-j - 1));
}
fh[i] = min(fh[i], *mov.begin());
arr[i].clear();
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
308 KB |
Output is correct |
4 |
Correct |
15 ms |
468 KB |
Output is correct |
5 |
Correct |
15 ms |
480 KB |
Output is correct |
6 |
Correct |
15 ms |
500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
296 ms |
29532 KB |
Output is correct |
3 |
Correct |
145 ms |
10988 KB |
Output is correct |
4 |
Correct |
415 ms |
26700 KB |
Output is correct |
5 |
Correct |
201 ms |
19096 KB |
Output is correct |
6 |
Correct |
183 ms |
16796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
16 ms |
500 KB |
Output is correct |
5 |
Correct |
15 ms |
500 KB |
Output is correct |
6 |
Correct |
15 ms |
468 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
308 ms |
30256 KB |
Output is correct |
9 |
Correct |
147 ms |
11744 KB |
Output is correct |
10 |
Correct |
449 ms |
27688 KB |
Output is correct |
11 |
Correct |
199 ms |
19916 KB |
Output is correct |
12 |
Correct |
188 ms |
17580 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Incorrect |
242 ms |
23580 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
15 ms |
440 KB |
Output is correct |
5 |
Correct |
15 ms |
468 KB |
Output is correct |
6 |
Correct |
15 ms |
440 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
302 ms |
30352 KB |
Output is correct |
9 |
Correct |
146 ms |
11764 KB |
Output is correct |
10 |
Correct |
455 ms |
27600 KB |
Output is correct |
11 |
Correct |
203 ms |
19880 KB |
Output is correct |
12 |
Correct |
189 ms |
17544 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Incorrect |
258 ms |
23748 KB |
Output isn't correct |
15 |
Halted |
0 ms |
0 KB |
- |