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

忘记初始化city1,贡献了一次wa,说下DP思路,大牛的话就直接无视掉好了~~

Posted by conanhjj at 2009-02-18 11:10:04 on Problem 3230
opt[i][j]表示第i天在City j的时候能获得的最大收入
payment[i][j] 从City i到City j的花费
getMoney[i][j] 第i天在City j能得到的收入

opt[i][j]=MAX{opt[i-1][j]-payment[j][j]+getMoney[i][j],
             (1<=k<=n),opt[i-1][k]-payment[k][j]+getMoney[i][j]}
初始化条件:
opt[0][1]=0
(1<=j<=n)
opt[1][j]=opt[0][1]-payment[1][j]+getMoney[1][j];

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