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

第50题留念

Posted by dy13145687 at 2014-08-11 13:37:28 on Problem 2533
#include <iostream>
using namespace std;

int numb[1010];
int dp[1010];
int N;

int findMax(int op){//寻找op和N间的最大值 
	int max = 0;
	int temp = op;
	for(; op < N; op++){
		if(numb[temp] < numb[op] && max < dp[op]){
			max = dp[op];
		}
	} 
	return max;
}

int main(){
	int i, max = 1;
	cin>>N;
	
	
	/*输入部分*/
	for(i = 0; i < N; i++){
		cin>>numb[i];
	}
	
	dp[N - 1] = 1;
	for(i = N - 2; i >= 0; i--){
		dp[i] = findMax(i) + 1;
		max = max > dp[i] ? max : dp[i];
	} 
	cout<<max<<endl;
	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