| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:如何做到0毫秒的.......In Reply To:如何做到0毫秒的....... Posted by:200730720207 at 2009-05-05 15:37:52 动态规划已经很牛B了。。。 初学。。水过。。
#include "stdio.h"
int main()
{
int i,j,n,result=-1,a[1001],c[1001];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
c[i]=1;
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]<a[j])
if(c[i]+1>c[j])
c[j]=c[i]+1;
}
}
for(i=0;i<n;i++)
if(result<c[i])
result=c[i];
printf("%d\n",result);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator