Submission #96079

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
960792019-02-05 16:26:25Alexa2001Watching (JOI13_watching)C++17
0 / 100
97 ms15976 KiB
#include <bits/stdc++.h>
using namespace std;
const int Nmax = 2005, inf = 1e9;
int N, P, Q, n;
int A[Nmax], a[Nmax], dp[Nmax][Nmax];
bool check(int W)
{
int i, j = 1, k = 1, it;
for(i=1; i<=N; ++i)
{
while(W - 1 < A[i] - A[j]) ++j;
while(2*W - 1 < A[i] - A[k]) ++k;
for(it=0; it<=i && it<=P; ++it)
dp[i][it] = min( (it != 0 ? dp[j-1][it-1] : inf), dp[k-1][it] + 1);
for(; it<=P; ++it) dp[i][it] = inf;
}
return (dp[N][P] <= Q);
}
int main()
{
// freopen("input", "r", stdin);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...