2682: 最大连续和(不超过m个)

Memory Limit:128 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:74 Solved:24

Description

n个数,求最大连续子序列的和,连续子序列的长度不超过m。

Input

n、m、n个数

Output

Sample Input Copy

6 3
6 -1 2 -6 5 -5

Sample Output Copy

7

HINT

50%的数据,n<=100000

100%的数据,n<=200000

Source/Category

加入题单

算法标签: