#include "mountains.h"
#include <vector>
#include <iostream>
using namespace std;
int tag[2005][2005],no,num[2005],tag2[2005],dp[2005];
int maximum_deevs(std::vector<int> y) {
int n=y.size(),ans=0;
for(int i=0;i<n;i++)
{
int tmp=0;
double ma=999999999999;
for(int j=i-1;j>=0;j--)
{
if((double)(y[i]-y[j])/(double)(i-j)<=ma)
{
tmp++;
tag[i][j]=1;
ma=(double)(y[i]-y[j])/(double)(i-j);
}
}
ma=-999999999999;
num[i]=tmp;
//cout<<num[i]<<endl;
}
dp[0]=1;
for(int i=1;i<n;i++)
{
for(int j=0;j<i;j++)
{
if(tag[i][j]==1)continue;
dp[i]=max(dp[i],dp[j]+1);
}
ans=max(dp[i],ans);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |