cugb 1050 导弹拦截
来源:互联网 发布:淘宝文翼多论文怎么样 编辑:程序博客网 时间:2024/06/06 18:26
最大下降子序列的问题,和上升自序列一样只不过倒了过来
#include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>#include<algorithm>using namespace std;int main(){ int j,i,n,s[30],b[30],max=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&s[i]); b[i]=1; } for(i=n-1;i>=0;i--) { for(j=i-1;j>=0;j--) { if(s[j]>=s[i]&&b[j]<b[i]+1) b[j]=b[i]+1; } } for(i=0;i<n;i++) { if (max<b[i]) max=b[i]; } printf("%d\n",max); system("pause"); return 0;}
- cugb 1050 导弹拦截
- CUGB 1050 拦截导弹 【DP】
- cugb 1050 导弹拦截(动态规划,LIS)
- cugb 1050 拦截导弹 (最长不升子序列)
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 导弹拦截
- 导弹拦截
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- 拦截导弹
- Linux中使用iconv命令对文件进行编码转换
- js函数内嵌函数的整体跳出
- android alarm
- windows创建DB2数据库时报错--SQL1052N 数据库路径不存在
- MacOS启用root账户
- cugb 1050 导弹拦截
- ICMP报文
- CSDN新版下载频道介绍之三——用户权限及积分规则详解
- form的提交时检验
- Ubuntu10.04自带Document Viewer看中文PDF的问题解决
- Flash/Flex中旋转文字,但不嵌入字体的研究
- identifier of an instance of Object is altered from 2 to 5
- js和php的异步传输
- vc6.0 打开文件的时候出现Microsoft Visual C++:MSDEV.EXE 应用程序错误