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 |
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator