| ||||||||||
| 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 | |||||||||
why wrong answer ?#include <stdio.h>
#include <string.h>
int main()
{
float value[100000];
int i,j,k;
int best[100000];
int n;
int result;
freopen("A.IN","r",stdin);
while(scanf("%d", &n)!=EOF)
{
if(n == 0)
{
printf("0\n");
continue;
}
result = best[0] = 1;
scanf("%f",&value[0]);
for(i = 1; i < n; i++)
{
scanf("%f",&value[i]);
best[i] = 1;
for(j = 0; j <= i; j++)
{
if(value[i] > value[j])
if(best[j] + 1 >= best[i])
best[i] = best[j] + 1;
}
if(best[i] > result)
result = best[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