AcWing 1017. 怪盗基德的滑翔翼
2024-08-28 17:07:18
#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 ;
}
最新文章
- python_java_selenium_ jenkins持续集成Firfox_chrome浏览器不显示的解决方法?
- ASP.NET后台获取cookie中文乱码解决办法
- QT 常用控件二
- RabbitMQ之前的那些事
- [OpenCV] 3、直线提取 houghlines
- SWUST0249 (凸包面积)
- 【技能】使用纯CSS+html写出方向箭头,简单慷慨,好看
- 【技术贴】jsp出现getOutputStream() has already been calle
- Bellman 算法
- U盘安装Ubuntu kylin版
- 玩转python之每次处理一个字符
- 老李推荐:第1章2节《MonkeyRunner源码剖析》概述:边界
- &;quot;Insufficient RAM for Flash Algorithms&;quot;出错原因及解决方式
- hadoop2.6.0实践:A03 例子验证
- python-tqdm进度条
- .NET程序员所需要注意的网站资源
- Linux内存描述之内存区域zone--Linux内存管理(三)
- AI佳作解读系列(二)——目标检测AI算法集杂谈:R-CNN,faster R-CNN,yolo,SSD,yoloV2,yoloV3
- git工具
- [CodeForces - 276A] Lunch Rush
热门文章
- IBM x3250m5安装redhat 6.5 加载raid卡驱动
- cf1280B
- P2746 [USACO5.3]校园网Network of Schools [tarjan缩点]
- (办公)记事本_linux关机和重启命令
- Magento2 updated quote_item table - 更新quote_item 表自定义字段
- java 快速生成树的方式
- Ansible之优化提升执行效率
- 【spring】(填坑)sql注入攻击 - 持久层参数化
- c#判断字符串是否可以转日期格式
- PAT (Advanced Level) Practice 1005 Spell It Right (20 分) (switch)