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一定是无后效性的 这里后面取值能改变前面的b

Posted by tzkq at 2008-11-09 02:36:49 on Problem 1018 and last updated at 2008-11-09 04:15:53
In Reply To:用DP做的,WA,不知为什么!!! Posted by:applesun at 2008-03-10 14:34:53
如果一定要用dp的话

可以把厂商那一维做成关于b的

这个题没有给b的范围,其实如果b很大的话,任何方法都不可能有效的做出来

a[][]里面记录的是price  ,当然一定是最小的

a[i][j] = min(a[i][j],a[i-1][j]+v[i][k].price) 

a[i][j]是指 第i种设备的第j带宽

这里 v[i][k] 是指第i种设备的第k个厂商 这里应该满足 v[i][k].band>=j;

我刚才专门写了过了下,发现b在350左右

tzkq	1018	Accepted	492K	63MS	C++	491B

这里是通过情况

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