제출 #246316

#제출 시각아이디문제언어결과실행 시간메모리
246316SortingGlobal Warming (CEOI18_glo)C++14
28 / 100
2095 ms1152 KiB
#include <bits/stdc++.h> using namespace std; const int k_N = 2e5 + 3; const int k_Inf = 1e9 + 3; int n, x; int t[k_N]; int get_lis(){ vector<int> dp; dp.push_back({-k_Inf}); for(int i = 0; i < n; ++i){ auto it = lower_bound(dp.begin(), dp.end(), t[i]); if(it == dp.end()) dp.push_back(t[i]); else dp[it - dp.begin()] = t[i]; } return (int)dp.size() - 1; } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cin >> n >> x; for(int i = 0; i < n; ++i) cin >> t[i]; int ans = 0; for(int r = 0; r < n; ++r){ t[r] -= x; ans = max(get_lis(), ans); } cout << ans << "\n"; }
#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...