이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |