Submission #575163

#TimeUsernameProblemLanguageResultExecution timeMemory
575163d4xnMountains (IOI17_mountains)C++17
0 / 100
1 ms308 KiB
#include "mountains.h" #include <bits/stdc++.h> using namespace std; #define ld long double const int N = 2001; int n, ans; int dp[N]; int maximum_deevs(vector<int> y) { n = y.size(); ans = 1; for (int i = 0; i < n; i++) { dp[i] = 1; for (int j = i-1; j >= 0; j--) { for (int k = j+1; k < i; k++) { ld h = y[j] + (k-j) * (y[i]-y[j]) / (i-j); if (y[k] > h) dp[i] = max(dp[i], dp[j]+1); } } ans = max(ans, dp[i]); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...