#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int temp;
while(scanf("%d",&n)!=EOF)
{
set<int>a;
for(int i=0;i<n;i++)
{
scanf("%d",&temp);
set<int>::iterator it=a.lower_bound(temp);
if(it!=a.end())
{
a.erase(*it);
a.insert(temp);
}
else
a.insert(temp);
}
printf("%d\n",a.size());
}
return 0;
}
07-18
1067
07-18
286
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交