| ||||||||||
| 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 | |||||||||
2533 就教为什么 这样做是WA 而;另一种是对的,谢谢大家#include<stdio.h>
#define m 1001
int main(void)
{
int max=1,len[1001],a[1001]={0},i,j,longest=0,n;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
for(j=0;j<i;j++)
{
len[i]=1;
if(a[j]<a[i])
{
max=len[j]+1;
}
if(max>len[i])
{
len[i]=max;
}
}
if(len[i]>longest)
{
longest=len[i];
}
}
printf("%d\n",longest);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator