Submission #581685

#TimeUsernameProblemLanguageResultExecution timeMemory
581685kamilamartinezGlobal Warming (CEOI18_glo)C++14
10 / 100
111 ms2992 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, x, i; cin >> n >> x; vector <ll> xd; xd.assign(n, 0); for(i=0;i<n;i++) { cin >> xd[i]; } vector<ll> lol = {xd[0]}; for (i = 1; i < n; ++i) { if (xd[i] > lol.back()) { lol.push_back(xd[i]); } else { auto it = lower_bound(lol.begin(), lol.end(), xd[i]); *it = xd[i]; } } cout << lol.size() << endl; 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...