标签:
Given an array of integers and a number k, find k non-overlapping
subarrays which have the largest sum.
The number in each subarray should be contiguous.
Return the largest sum.
The subarray should contain at least one number
Given [-1,4,-2,3,-2,3]
, k=2
, return 8
这是一题划分类型的题目, 划分类型的题目只关心划分位,而不关心区间里面的内容.针对这题来说,我们只划分数组,并不是划分的区间内的所有数字形成的子数组就是我们在这个划分中要找的,可能是子子数组, 和区间型DP(Scramble String
Burst Balloons)形成了比较大的区别.这点需要注意. 也是划分类DP这种
标签:
原文地址:http://www.cnblogs.com/sherylwang/p/5635665.html