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 xiaosiwei at 2010-04-05 09:11:43 on Problem 1717
因为sum1 + sum2的值为固定的。
所以可以想到以点数做为背包。
dp[i][j]表示前i个,上面的数的总和达到j的最小需要翻的次数。。。
有点绕。
最后输出只要找到最小的Abs(sum1[n]+sum2[n]-2*i)即可。

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