제출 #503020

#제출 시각아이디문제언어결과실행 시간메모리
503020DanerZeinFinancial Report (JOI21_financial)C++14
5 / 100
143 ms11708 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n,d; cin>>n>>d; vector<ll> x; for(int i=0;i<n;i++){ ll a; cin>>a; x.push_back(a); } vector<ll> lis; for(int i=0;i<n;i++){ if(lis.empty()){ lis.push_back(x[i]); continue; } auto it=lower_bound(lis.begin(),lis.end(),x[i]); if(it==lis.end()) lis.push_back(x[i]); else{ int id=it-lis.begin(); lis[id]=x[i]; } } cout<<lis.size()<<endl; }
#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...