poj1887(最长下降子序列)
来源:互联网 发布:遥感软件 编辑:程序博客网 时间:2024/05/21 09:00
#include<iostream>#include<cstdio>#include<cstring>using namespace std;#define maxn 100000int f[maxn];int a[maxn];int main(){ int cas=0; int b,c; while(scanf("%d",&b)&&b!=-1) { int i=0; a[i++]=b; while(scanf("%d",&c)&&c!=-1) { a[i++]=c; } memset(f,0,sizeof(f)); int ans=0; for(int j=0;j<i;j++) { f[j]=1; for(int k=0;k<j;k++) { if(a[k]>=a[j]&&f[k]+1>f[j]) f[j]=f[k]+1; } } for(int j=0;j<i;j++) { if(f[j]>ans) ans=f[j]; } printf("Test #%d:\n",++cas); printf(" maximum possible interceptions: %d\n\n",ans); } return 0;}
0 0
- poj1887(最长下降子序列)
- POJ1887 最长下降子序列
- poj1887(最长下降子序列)
- poj1887--最长下降子序列(LIS && LDS)问题
- poj1887最长降子序列
- poj1887(最长递减子序列)
- UVALive5170 UVA231 POJ1887 Testing the CATCHER【最长下降子序列+DP+二分搜索】
- 最长下降子序列
- 最长下降子序列
- 最长下降子序列
- POJ1887 Testing the CATCHER 最大下降子序列 DP
- 最长上升子序列LIS集合 POJ2533,POJ1631,POJ1887,POJ1609
- 最长不下降子序列
- 最长上升下降子序列
- 最长不下降子序列
- 最长不下降子序列
- 最长不下降子序列
- 最长不下降子序列
- Python 读写文件 中文乱码 错误TypeError: write() argument must be str, not bytes+
- memcacheq安装与消息队列
- 搭建FTP服务器
- 第十一周项目1--(2)二叉树构造算法的验证--由顺序存储结构转为二叉链存储结构
- $.ajax传参数数组的情况
- poj1887(最长下降子序列)
- BZOJ 2434: [Noi2011]阿狸的打字机(fail树+树状数组)
- vs调用matlab的动态库(matlab为卡尔曼滤波相关算法)
- GIT 安装和使用
- 数据结构==翻译程序
- PHP number_format() 函数定义和用法
- 难以提高的困扰
- Spring----创建Bean的3种方式
- 搭建vatic , apache载入系统python,而不是期望的anaconda的~/anconda/bin/python