Submission #581684

#TimeUsernameProblemLanguageResultExecution timeMemory
581684elpro123Global Warming (CEOI18_glo)C++14
10 / 100
109 ms1752 KiB
#include <bits/stdc++.h> #define pb push_back #define sz(x) ((int)((x).size())) #define all(x) (x).begin(), (x).end() using namespace std; typedef vector<int> vi; const int N=2e5+10; int n, x, t[N]; int main(){ cin>>n>>x; for(int i=0; i<n; i++){ cin>>t[i]; } assert(x==0); vi lis; for(int i=0; i<n; i++){ int in=lower_bound(all(lis), t[i])-lis.begin(); if(in==sz(lis)){ lis.pb(t[i]); }else { lis[in]=t[i]; } } cout<<sz(lis)<<"\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...