题解 | #子数组最大连续和#
不相邻取数
http://www.nowcoder.com/practice/a2be806a0e5747a088670f5dc62cfa1e
while True:
try:
n = int(input())
nums = list(map(int, input().split()))
pre, Max = 0, nums[0]
for n in nums:
pre = max(pre + n, n)
Max = max(pre, Max)
print(Max)
except:
break