思路:
采用动态规划进行求解,令:
maxSum[k]表示子串list{0,k}的最大连续子串和,
maxSumIncludeK[k]表示子串list{0,k}中末尾为k的最大连续子串和,
则
maxSumIncludeK[k] = max(list[k],list[k]+maxSumIncludeK[k-1]),
maxSum[k] = max(maxSumIncludeK[k],maxSum[k...
6-05 2,148 views
思路:
采用动态规划进行求解,令:
maxSum[k]表示子串list{0,k}的最大连续子串和,
maxSumIncludeK[k]表示子串list{0,k}中末尾为k的最大连续子串和,
则
maxS...