#include<iostream>
using namespace std ;
const int N=;
int f[N],g[N];
int w[N];
int main() {
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
int res=;
for(int i=; i<=n; i++) cin>>w[i];
for(int i=; i<=n; i++) {
f[i]=;
for(int j=; j<i; j++) {
if(w[i]>w[j]) f[i]=max(f[i],f[j]+);
}
res=max(res,f[i]);
}
for(int i=n; i>=; i--) {
g[i]=;
for(int j=n; j>i; j--) {
if(w[i]>w[j]) g[i]=max(g[i],g[j]+);
}
res=max(res,g[i]);
}
cout<<res<<endl;
}
return ;
}

最新文章

  1. python_java_selenium_ jenkins持续集成Firfox_chrome浏览器不显示的解决方法?
  2. ASP.NET后台获取cookie中文乱码解决办法
  3. QT 常用控件二
  4. RabbitMQ之前的那些事
  5. [OpenCV] 3、直线提取 houghlines
  6. SWUST0249 (凸包面积)
  7. 【技能】使用纯CSS+html写出方向箭头,简单慷慨,好看
  8. 【技术贴】jsp出现getOutputStream() has already been calle
  9. Bellman 算法
  10. U盘安装Ubuntu kylin版
  11. 玩转python之每次处理一个字符
  12. 老李推荐:第1章2节《MonkeyRunner源码剖析》概述:边界
  13. &amp;quot;Insufficient RAM for Flash Algorithms&amp;quot;出错原因及解决方式
  14. hadoop2.6.0实践:A03 例子验证
  15. python-tqdm进度条
  16. .NET程序员所需要注意的网站资源
  17. Linux内存描述之内存区域zone--Linux内存管理(三)
  18. AI佳作解读系列(二)——目标检测AI算法集杂谈:R-CNN,faster R-CNN,yolo,SSD,yoloV2,yoloV3
  19. git工具
  20. [CodeForces - 276A] Lunch Rush

热门文章

  1. IBM x3250m5安装redhat 6.5 加载raid卡驱动
  2. cf1280B
  3. P2746 [USACO5.3]校园网Network of Schools [tarjan缩点]
  4. (办公)记事本_linux关机和重启命令
  5. Magento2 updated quote_item table - 更新quote_item 表自定义字段
  6. java 快速生成树的方式
  7. Ansible之优化提升执行效率
  8. 【spring】(填坑)sql注入攻击 - 持久层参数化
  9. c#判断字符串是否可以转日期格式
  10. PAT (Advanced Level) Practice 1005 Spell It Right (20 分) (switch)