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

一个三维dp

Posted by 2008022118 at 2010-01-24 01:52:01 on Problem 2626
空间复杂度确实高了。statu中居然有16k的,肯定有好方法。先说一下my solve。
dp[i][j][k],前i个,选j个黑的,k个白的。
dp[i][j][k] = max(dp[i-1][j][k],dp[i-1][j-1][k]+A[i][0],
                     dp[i][j][k-1]+A[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