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 snoopy at 2006-07-26 16:37:30 on Problem 1015
In Reply To:我的思路是这样的,大家看对不对? Posted by:relive_7 at 2006-07-21 20:31:03
我前几天也是这么想的,优化了很久,最后发现还是错的

比如前面存在10,10和10,20这样的子结构,你选的最优一定是10,10,而下一个来的是一个20,10,那么配合10,20就是当前的最优结构,看你能判断这种情况不?

我现在卡这里了,本来想重新回归搜索去硬搞,但是看又有人说DP的思想是没问题的...迷惑中...

> 根据dp原理,把问题规模缩小到1,然后从1开始算起,把剩下所有的候选人都遍历一遍,选出最优,然后再做一知道n为止(n是题目要求的人数)

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