Submission #819145

#TimeUsernameProblemLanguageResultExecution timeMemory
819145TS_2392Global Warming (CEOI18_glo)C++14
27 / 100
29 ms972 KiB
#include <bits/stdc++.h> #define pb push_back #define lwb lower_bound #define all(x) (x).begin(), (x).end() using namespace std; const int N = 2e5 + 3; int n, x; vector<int> lis; void solve(int v){ vector<int>::iterator it = lwb(all(lis), v); if(it == lis.end()) lis.pb(v); else *it = v; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> x; for(int i = 1; i <= n; ++i){ int a; cin >> a; if(x != 0) solve(a + x); solve(a); } cout << lis.size(); 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...