题解 | #连续子数组最大和(ACM版本)#
连续子数组最大和(ACM版本)
http://www.nowcoder.com/practice/1718131e719746e9a56fb29c40cc8f95
while True:
try:
a = int(input())
b = list(map(int,input().split()))
dp = [0]*a
for i in range(a):
if i == 0:
dp[i] = b[i]
else:
dp[i] = max(dp[i-1]+b[i],b[i])
print(max(dp))
except:
break