Submission #282769

#TimeUsernameProblemLanguageResultExecution timeMemory
282769dooweyGlobal Warming (CEOI18_glo)C++14
28 / 100
2086 ms5236 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); const ll inf = (ll)1e10; int main(){ fastIO; int n; ll x; cin >> n >> x; vector<ll> v(n); for(int i = 0 ; i < n; i ++ ){ cin >> v[i]; } ll ans = 0; for(int k = 0 ; k <= n; k ++ ){ vector<ll> nw; for(int y = 0; y < n ; y ++ ){ if(y < k) nw.push_back(v[y]-x); else nw.push_back(v[y]); } vector<ll> dp(n); for(int i = 0 ; i < n; i ++ ){ dp[i]=1; for(int j = 0; j < i ; j ++ ){ if(nw[i]>nw[j]) dp[i]=max(dp[i],dp[j]+1); } ans=max(ans,dp[i]); } } cout << ans; return 0; }
#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...