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

1015这么做对吗?帮忙过来看下:-)

Posted by linuxfan at 2009-06-08 13:35:12 on Problem 1015
类似于背包问题。具体思路如下:
dp[i][j]表示从前i个人中选出j个人时最小差。则转移方程如下:
dp[i][j] = min{|dp[k][j-1]+A[i]-B[i]|},j-1=<k<i.绝对值只是用来查找最小差的,dp[][]仍然保存正负号。
这种想法对吗?望大牛指点下.

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