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 jourkliu at 2008-11-26 17:05:38 on Problem 1050
此题用枚举的方法把二维的问题转化成一位的问题,再运用动态规划的方法解决,该算法的时间复杂度为O(N^3)。
动态规划的核心代码(部分):
tmp=0;
for(k=1;k<=n;k++)
{
if(tmp>=0) tmp+=sum[k];
else tmp=sum[k];
if(ans<tmp) ans=tmp;
}

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