题解 | #子数组的最大累加和问题#
子数组的最大累加和问题
http://www.nowcoder.com/practice/38014783330445b4936ccfad9990431c
n = int(input())
nums = list(map(int, input().split()))
before = nums[0]
res = nums[0]
for i in range(1, n):
before = max(nums[i], nums[i] + before)
res = max(res, before)
print(res)