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;
typedef long long ll;
const int N = 222222;
ll a[N], l[N];
int main()
{
ll n, x;
cin >> n >> x;
for(int i = 1; i <= n; i ++)
cin >> a[i];
int lis = 0;
for(int i = 1; i <= n; i ++)
{
int id = lower_bound(l, l + lis, a[i]) - l;
l[id] = a[i];
if(id == lis)
lis ++;
}
cout << lis;
}
# | 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... |