| ||||||||||
| 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 | |||||||||
无语了,,这题都WA,,先B4自己,,再大声喊,,HELP.....喊错了,,B4 again#include <stdio.h>
#include <memory.h>
void main()
{
long i,j,n,num[1001],step[1001],max;
scanf("%ld",&n);
memset(step,0,sizeof(int)*1001);
num[0]=-1;
for(i=1;i<=n;i++)
{
scanf("%ld",&num[i]);
}
for(i=1;i<=n;i++)
for(j=0;j<i;j++)
{
if(num[j]<num[i]&&step[j]+1>step[i])step[i]=step[j]+1;
}
max=0;
for(i=1;i<=n;i++)
{
if(max<step[i])max=step[i];
}
if(max==1)printf("0\n");
else
printf("%ld\n",max);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator