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 happynp at 2009-02-25 10:32:19 on Problem 1243
// i guesses 和 j lifelines能否猜对价格n
bool check(int g, int l, int n) {
	if(l==0) return g>=n;
	else if(g==1) return n==1;
	else {
		if(n<=1) return true;
		int k=0;
		for(k=1; k<n; k++) {
			if(check(g-1, l-1, k) && check(g-1, l, n-k-1)) return true;
		}
		return false;
	}
}

// 设m[i,j]是i guesses 和 j lifelines能猜对的最大价格;
// 则m[i,j] = max{ m[i-1,j-1] + m[i-1,j] + 1 }

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