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

这道题我写了两个状态方程,一个AC,一个WA.请大家帮我看看.

Posted by humanjustic at 2007-02-05 16:24:27 on Problem 2626
WA的方程是:
dp[w][all][i]代表在前i的人中选了all个,其中有w个play white的最大和
dp[w][all][i] = Max(dp[w][all][i-1],dp[w-1][all-1][i-1]+item[i].w,dp[w][all-1][i-1] + item[i].b);
AC的方程是:
dp[w][b][i]代表在前i个人中选了w个人play white,b个人play black的最大和
dp[w][b][i] = Max(dp[w-1][b][i-1] + item[i].w,dp[w][b-1][i-1] + item[i].b,item[w][b][i-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