Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

那位大神帮看下,哪错了???

Posted by yanlu521521 at 2011-08-06 21:03:51 on Problem 2533
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator