Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
解题报告是否有问题啊 。。。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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator