n=int(input())
a=list(map(int, input().split()))
s=[a[0]]
for i in range(n-1):
s.append(max(s[i]+a[i+1],a[i+1]))
print(max(s))
'백준 풀이' 카테고리의 다른 글
백준 10844번 파이썬 (0) | 2022.08.29 |
---|---|
백준 1874번 파이썬 (스택) (0) | 2022.08.28 |
파이썬 15649번 파이썬 (백트레킹 by dfs) (0) | 2022.08.28 |
백준 1002번 파이썬 (0) | 2022.08.28 |
백준 1002번 파이썬 (0) | 2022.08.28 |