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 |
Re:这道题我写了两个状态方程,一个AC,一个WA.请大家帮我看看.In Reply To:这道题我写了两个状态方程,一个AC,一个WA.请大家帮我看看. Posted by:humanjustic at 2007-02-05 16:24:27 > 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator