裸题

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define R(a,b,c) for(register int a = (b); a <= (c); ++ a)
#define nR(a,b,c) for(register int a = (b); a >= (c); -- a)
#define Max(a,b) ((a) > (b) ? (a) : (b))
#define Min(a,b) ((a) < (b) ? (a) : (b))
#define Fill(a,b) memset(a, b, sizeof(a))
#define Abs(a) ((a) < 0 ? -(a) : (a))
#define Swap(a,b) a^=b^=a^=b
#define ll long long #define ON_DEBUG #ifdef ON_DEBUG #define D_e_Line printf("\n\n----------\n\n")
#define D_e(x) cout << #x << " = " << x << endl
#define Pause() system("pause")
#define FileOpen() freopen("in.txt","r",stdin); #else #define D_e_Line ;
#define D_e(x) ;
#define Pause() ;
#define FileOpen() ; #endif struct ios{
template<typename ATP>ios& operator >> (ATP &x){
x = 0; int f = 1; char c;
for(c = getchar(); c < '0' || c > '9'; c = getchar()) if(c == '-') f = -1;
while(c >= '0' && c <= '9') x = x * 10 + (c ^ '0'), c = getchar();
x*= f;
return *this;
}
}io;
using namespace std; const int N = 100007; int a[N], b[N];
int main(){
int n;
io >> n;
R(i,1,n){
io >> a[i];
}
int len = 0;
b[++len] = a[1];
R(i,2,n){
if(a[i] > b[len]){
b[++len] = a[i];
}
else{
int pos = upper_bound(b + 1, b + len + 1, a[i]) - b;
b[pos] = a[i];
}
} printf("%d", len);
return 0;
}

最新文章

  1. history 清空历史记录 或 history不记录历史命令
  2. STL UVA 11991 Easy Problem from Rujia Liu?
  3. OpenERP中的会计凭证
  4. 企业网管软件实战之SolarWinds LANsurveyor
  5. mysql show命令集合
  6. chmod -x chmod的N种解法
  7. PHP获取随机数
  8. 作业2——需求分析&amp;原型设计
  9. 分布式唯一id:snowflake算法思考
  10. Angular5 路由守卫
  11. maven构建myeclipse 工程
  12. [iptables] 如何用iptables管理桥接模式下的设备
  13. .Net Core 项目在Windows服务中托管【转载】
  14. 用redux-thunk异步获取数据
  15. nginx配置文件优化
  16. leetcode63&mdash;Unique Path II
  17. C# int.ToString() 常用参数说明
  18. 怎么理解Linux软中断?
  19. 撩课-Web大前端每天5道面试题-Day26
  20. 利用kaptcha生成验证码的详细教程

热门文章

  1. 【Axure】母版引发事件
  2. 20212115朱时鸿 《python程序设计》实验四报告
  3. 基于PYQT5的截图翻译工具
  4. 论文解读(SUBLIME)《Towards Unsupervised Deep Graph Structure Learning》
  5. R语言读取matlab中数据
  6. 9.Linux之iptables防火墙
  7. 国内外组态软件对比分析(InTouch、WinCC、iFix、iNeuOS)
  8. 命令行工具tabby--gi t仓库Token的使用
  9. kali渗透测试阅读目录
  10. UiPathExcel读取操作