제출 #763350

#제출 시각아이디문제언어결과실행 시간메모리
763350giaminh2211Financial Report (JOI21_financial)C++14
0 / 100
37 ms2876 KiB
#include <bits/stdc++.h>
#define taskname "CDKG"

using namespace std;
using ll=long long;
using ldb=long double;
using ull=unsigned long long;

int n;
int a[300002];
int b[300002];
int kq=0;
int k;

void nhap(){
	int d;
    cin >> n >> d;
    for(int i=1; i<=n; i++){
        cin >> a[i];
    }
}

void solve(){
    b[0]=-1e9;
    for(int i=1; i<=n; i++){
        b[i]=1e9;
    }
    for(int i=1; i<=n; i++){
        k=lower_bound(b+1,b+i,a[i])-b;
        b[k]=a[i];
        kq=max(kq,k);
    }
    cout << k;
}

int main(){
    //freopen(taskname".INP", "r", stdin);
    //freopen(taskname".OUT", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    nhap();
    solve();
}
#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...