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>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define int long long
#define N 200200
int n , x , p , rt , a[N] , b[N];
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> x;
for (int i = 1 ; i <= n ; i ++) cin >> a[i] , b[i] = 2e9;
for (int i = 1 ; i <= n ; i ++){
p = lower_bound(b , b + n + 1 , a[i]) - b;
rt = max(rt,p) , b[p] = a[i];
}
cout << rt;
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |