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 thwfhk at 2016-11-03 22:57:47 on Problem 2479
d[i][0]前i个以i结尾选了一段
d[i][1]前i个以i结尾选了两段
然后扫描维护一个d[i][0]的最大值mx,转移
d[i][0]=max(0,d[i-1][0])+a[i];

d[i][1]=max(d[i-1][1],mx)+a[i];

初始化注意一下就行了


代码见:http://www.cnblogs.com/candy99/p/6028647.html

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