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

解题报告是否有问题啊 。。。

Posted by wahahaha at 2005-08-30 10:04:45 on Problem 2593
Max Sequence

首先使用简单的动态规划计算A[i]和B[i](1 <= i <= N),A[i]和B[i]分别表示从最左端到i和从最右端到i + 1的序列中,和最大子序列的值,这里计算的复杂度是O(N)。然后枚举i,A[i] + B[i]最大的值就是结果,这里的复杂度也是O(N)。因此总的复杂度为O(N)。




?????计算A[i]怎么才O(1)??怎么DP??好象跟A[i-1]没有直接关系啊

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