Submission #819123

#TimeUsernameProblemLanguageResultExecution timeMemory
819123TS_2392Global Warming (CEOI18_glo)C++14
27 / 100
32 ms1056 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; lis.pb(-100000000); for(int i = 1; i <= n; ++i){ int a; cin >> a; solve(a + x); solve(a); } cout << lis.size() - 1; 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...