| ||||||||||
| 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 | |||||||||
^_^// 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator