| ||||||||||
| 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 | |||||||||
那位大神帮看下,哪错了???#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int Num[1002];
int DP[1002];
int main()
{
int Cases, Max;
while( cin >> Cases )
{
memset(DP,0,sizeof(DP));
for( int i=1; i<=Cases; ++i )
scanf("%d",Num+i);
Max=0;
DP[1] = 1;
for( int i=1; i<=Cases; ++i )
{
for( int j=1; j<i; ++j )
if( Num[i] > Num[j] && DP[j]>DP[i])
DP[i] = DP[j];
DP[i]++;
if( Max < DP[i] )
Max = DP[i];
}
printf("%d\n",Max);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator