标签:include amp ace pre efi else #define code return
#include<iostream> #include<algorithm> #include<cstdio> #define X 10000+7 using namespace std; int a[X],f[X]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;++i) { scanf("%d",&a[i]); } int len=1;f[1]=a[1]; for(int i=2;i<=n;++i) { if(a[i]>f[len])f[++len]=a[i]; else { int j=lower_bound(f+1,f+1+len,a[i])-f;f[j]=a[i]; } } printf("%d",len); return 0; }
标签:include amp ace pre efi else #define code return
原文地址:https://www.cnblogs.com/tpgzy/p/8849459.html