POJ-2533
来源:互联网 发布:自学数据库看什么书 编辑:程序博客网 时间:2024/04/29 21:10
#include<iostream>#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;int a[1005];int dp[1005];int main(){ int N; while(~scanf("%d",&N)){ int i,j; for(i=0;i<N;i++) cin>>a[i]; dp[0]=1; int max=1; for(i=1;i<N;i++){ int flag=-1; int max1=-1; for(j=i-1;j>=0;j--) if(a[j]<a[i]&&dp[j]>max1){ max1=dp[j]; flag=j; } if(flag!=-1)dp[i]=dp[flag]+1; else dp[i]=1; if(dp[i]>max)max=dp[i]; } cout<<max<<endl; } return 0;}
0 0
- POJ 2533
- POJ 2533
- POJ 2533
- poj 2533
- POJ 2533
- poj-2533
- poj--2533
- poj 2533
- POJ 2533
- POJ 2533
- POJ 2533
- poj 2533
- POJ-2533
- POJ 2533
- POJ 2533
- POJ 2533
- POJ 2533 O(NLogN)
- poj 2533 LCS
- 7.自定义Toast
- hdu 1087 Super Jumping! Jumping! Jumping!
- head first python 第三章
- POJ-2531
- openresty
- POJ-2533
- get_magic_quotes_gpc异常
- Android——PagerTabStrip和PagerTitleStrip异同
- POJ-2785
- POJ-3126
- 协方差矩阵的实例与意义
- JavaScript中,对this的简单记忆
- LeetCode:Single-Number
- POJ-3737