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;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()
int main()
{
ll n,d;
cin>>n>>d;
ll x;
vector<int>v;
for(int i=0;i<n;i++)
{
cin>>x;
if(!v.size() || v[v.size()-1]<x)
v.pb(x);
else
{
ll pos=lower_bound(all(v),x)-v.begin();
v[pos]=x;
}
}
cout<<v.size();
}
# | 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... |