Submission #692281

#TimeUsernameProblemLanguageResultExecution timeMemory
692281zeroesandonesMountains (IOI17_mountains)C++17
0 / 100
1 ms296 KiB
#include <bits/stdc++.h> #include "mountains.h" using namespace std; using ll = long long; using vi = vector<ll>; int maximum_deevs(vector<int> y) { int n = y.size(); vector<int> dp(n, 1); for(int i = 1; i < n; ++i) { bool bigger = false; set<int> seen; for(int j = i - 1; j >= 0; --j) { bigger |= (y[j] > y[i]); auto it = seen.upper_bound(y[j]); if(it != seen.end() && bigger) { dp[i] = max(dp[i], dp[j] + 1); } seen.insert(y[j]); } } return *max_element(dp.begin(), dp.end()); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...