标签:space bsp size end com name ons names image
代码:
#include<iostream>
#include<stdio.h>
using namespace std;
const int maxn = 1001;
int a[maxn],dp[maxn];
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
dp[i] =1;
}
int ans = 0;
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
if(a[j]>a[i]){
dp[j] = max(dp[j],dp[i]+1);
}
}
}
for(int i=1;i<=n;i++)
ans = max(ans,dp[i]);
cout<<ans<<endl;
return 0;
}
Poj 2533 Longest Ordered Subsequence
标签:space bsp size end com name ons names image
原文地址:https://www.cnblogs.com/lusiqi/p/12368143.html