# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1020311 |
2024-07-11T21:49:01 Z |
kym |
Radio Towers (IOI22_towers) |
C++17 |
|
4000 ms |
1576 KB |
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
vector<int>A;
int n;
void init(int N, std::vector<int> H) {
n=N;
A=H;
}
int max_towers(int L, int R, int D) {
int dp[n+5];memset(dp,0,sizeof dp);
for(int i=0;i<n;i++)dp[i]=1;
int ans=1;
for(int i=L+2;i<=R;i++){
int mx=A[i-1];
for(int j=i-2;j>=0;j--){
if(mx-D>=A[i] && mx-D >= A[j]){
dp[i]=max(dp[i],dp[j]+1);
ans=max(ans,dp[i]);
}
mx=max(mx,A[i]);
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4011 ms |
1132 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '14' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '14' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4075 ms |
1576 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4035 ms |
848 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
1st lines differ - on the 1st token, expected: '13', found: '14' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4011 ms |
1132 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |