Submission #444586

#TimeUsernameProblemLanguageResultExecution timeMemory
444586osmanallazovGlobal Warming (CEOI18_glo)C++14
10 / 100
103 ms1968 KiB
#include <bits/stdc++.h> using namespace std; int lis(vector<int>& arr) { vector<int> ans; int n = arr.size(); for (int i = 0; i < n; i++) { auto it = lower_bound(ans.begin(), ans.end(), arr[i]); if (it == ans.end()) { ans.push_back(arr[i]); } else { *it = arr[i]; } } return ans.size(); } int main() { int n,x,a; cin>>n>>x; int q=n; vector<int>v; while(q--){ cin>>a; v.push_back(a); } cout<<lis(v); }
#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...