# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
1067257 |
2024-08-20T13:32:26 Z |
n1k |
송신탑 (IOI22_towers) |
C++17 |
|
4000 ms |
2344 KB |
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> h;
void init(int N, std::vector<int> H) {
n = N;
h = H;
}
int find(int l, int r, int d, long long minh){
//cerr<<l<<" "<<r<<endl;
if(l>r) return 0;
array<int, 2> mx = {0};
for(int i=l; i<=r; i++){
mx = max(mx, {h[i], i});
}
return max({
int(mx[0]+d<=minh),
find(l, mx[1]-1, d, mx[0]) + find(mx[1] + 1, r, d, mx[0]),
find(l, mx[1]-1, d, minh),
find(mx[1] + 1, r, d, minh)
});
}
int max_towers(int L, int R, int D) {
return find(L, R, D, 1e18);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4030 ms |
2344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
130 ms |
344 KB |
Output is correct |
3 |
Correct |
129 ms |
344 KB |
Output is correct |
4 |
Correct |
759 ms |
428 KB |
Output is correct |
5 |
Correct |
165 ms |
344 KB |
Output is correct |
6 |
Correct |
8 ms |
344 KB |
Output is correct |
7 |
Correct |
37 ms |
344 KB |
Output is correct |
8 |
Execution timed out |
4100 ms |
344 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
130 ms |
344 KB |
Output is correct |
3 |
Correct |
129 ms |
344 KB |
Output is correct |
4 |
Correct |
759 ms |
428 KB |
Output is correct |
5 |
Correct |
165 ms |
344 KB |
Output is correct |
6 |
Correct |
8 ms |
344 KB |
Output is correct |
7 |
Correct |
37 ms |
344 KB |
Output is correct |
8 |
Execution timed out |
4100 ms |
344 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4030 ms |
1368 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4065 ms |
600 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
130 ms |
344 KB |
Output is correct |
3 |
Correct |
129 ms |
344 KB |
Output is correct |
4 |
Correct |
759 ms |
428 KB |
Output is correct |
5 |
Correct |
165 ms |
344 KB |
Output is correct |
6 |
Correct |
8 ms |
344 KB |
Output is correct |
7 |
Correct |
37 ms |
344 KB |
Output is correct |
8 |
Execution timed out |
4100 ms |
344 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
4030 ms |
2344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |