标签:blog http io strong for 2014 amp log
// 源程序2 DP
#include <stdio.h>
int n,ans, a[1001],b[1001];
int main()
{ int i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{ scanf("%d",&a[i]); b[i]=1; }
for(i=1;i<=n;i++)
for(j=1;j<=i;j++)
if(a[i]>a[j]&&b[j]+1>b[i]) b[i]=b[j]+1;
ans=1;
for(i=1;i<=n;i++)
if(ans<b[i]) ans=b[i];
printf("%d\n",ans);
return 0;
}
标签:blog http io strong for 2014 amp log
原文地址:http://www.cnblogs.com/2014acm/p/3914420.html