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

Re:请教一下这题最优解的结构,想不通,直接搜过了,不过太慢了

Posted by frkstyc at 2005-04-26 20:46:24 on Problem 1050
In Reply To:请教一下这题最优解的结构,想不通,直接搜过了,不过太慢了 Posted by:Loger at 2004-04-17 22:16:44
首先是做表来支持O(1)查询某个子式的和
枚举+二维压缩成一维需要O(n^2)
在一维上dp,dp方程s[k]=max(s[k-1],0)+a[k],需要O(n)
总共O(n^3),考虑规模n<=100,先鄙视一下,然后就做吧

> 不知怎样用dp来做,可以指教一下?

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