#include <bits/stdc++.h>
using namespace std;
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
typedef long long ll;
const int MAXN = 1000100;
const ll INF = 1e16;
int n, a, b;
ll dp[MAXN], t[MAXN];
int main()
{
FAST_IO;
cin >> n >> a >> b;
FOR(i, 1, n) cin >> t[i];
FOR(i, 1, n) dp[i] = INF;
FOR(i, a, n) FOR(j, max(0,i-b), i-a) dp[i] = min(dp[i], max(dp[j],t[i]-t[j+1]));
cout << dp[n] << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |