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 hhhh at 2006-08-19 10:44:30 on Problem 2978
In Reply To:请教这个怎么DP?拜谢 Posted by:nuanran at 2006-08-18 19:06:06
我的方法是d[100][5],d[i][j]表示第i个石头且最后一个为j的状态,每个状态里保存了最少拿走石子的数目和状态的序列。
转移时d[i][j]由d[i-1][0]~d[i-1][k-1]中转移代价最小的转移得到。
也就是说d[1][0]由d[0][0],d[0][1],d[0][2].....中转移代价最小的转移得到。同时保存最小代价时的序列。序列在转移时同时处理了。
这样有什么问题吗?

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