제출 #785150

#제출 시각아이디문제언어결과실행 시간메모리
785150makanhuliaGlobal Warming (CEOI18_glo)C++17
0 / 100
2061 ms4192 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, x; cin >> n >> x; vector<int> a(n); for(int &p : a) cin >> p; vector<int> dp; int ans=1; for(int i=0; i<n; i++) { for(int j=i; j<n; j++) { dp.clear(); vector<int> temp=a; for(int k=i; k<=j; k++) temp[k]+=x; for(int p : temp) { auto it=lower_bound(temp.begin(), temp.end(), p); if(it==temp.end()) dp.push_back(p); else *it=p; } ans=max(ans, (int)dp.size()); } } cout << ans << '\n'; 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...