| ||||||||||
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 |
一种新方法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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator