Submission #83687

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
836872018-11-09 21:17:18Bodo171구경하기 (JOI13_watching)C++14
50 / 100
220 ms16428 KiB
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;
const int nmax=2005;
int dp[nmax][nmax];
int v[nmax];
int n,p,q,i,j,p1,p2,val;
bool check(int val)
{
for(i=1;i<=n;i++)
for(j=0;j<=p;j++)
dp[i][j]=q+1;
p1=p2=1;
for(i=1;i<=n;i++)
{
while(v[i]-v[p1]+1>val)
p1++;
while(v[i]-v[p2]+1>2*val)
p2++;
for(j=1;j<=n;j++)
dp[i][j]=min(dp[p1-1][j-1],dp[p2-1][j]+1);
}
for(i=0;i<=p;i++)
if(dp[n][i]<=q)
return 1;
return 0;
}
int main()
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...