Submission #444460

#TimeUsernameProblemLanguageResultExecution timeMemory
444460fuad27Global Warming (CEOI18_glo)C++14
0 / 100
2093 ms2848 KiB
#include<bits/stdc++.h> using namespace std; int main () { int n, x; cin >> n >> x; vector<int> v(n, 0); for(int i = 0;i<n;i++) { int p; cin >> p; v[i] = p; } int dp[n], MAX = 0; dp[0] = 1; for(int i = 1;i<n;i++) { dp[i] = 1; for(int j = 0;j<i;j++) { if(v[j] <= v[i] and dp[j] +1 > dp[i]) { dp[i] = dp[j] + 1; } MAX = max(dp[i], MAX); } } cout<<MAX<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...