#include <iostream>
using namespace std; 
int i,j,n,s,t,a[100001];
int main()
{ 
    cin>>n;
    a[0]=-1000000;
    for(i=0;i<n;i++)
    {
        cin>>t;
        if(t>a[s]) a[++s]=t;
        else
        {
            int l=1,h=s,m;
            while(l<=h)
            {
                m=(l+h)/2;
                if(t>a[m]) l=m+1;
                else h=m-1;
            }
            a[l]=t;
        }
    }
    cout<<s<<endl;
}

 

相关文章:

  • 2021-08-10
  • 2022-03-05
  • 2021-09-29
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-09-18
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2022-02-07
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案