This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |