백준 :: 연속합 <1912번>

혜 콩·2022년 8월 30일
0

알고리즘

목록 보기
57/61

> 문제 <


https://www.acmicpc.net/problem/1912

> 아이디어 <

> 코드 <

n = int(input())
a = list(map(int, input().split()))
dp = [-1000] * n
dp[0] = a[0]

for i in range(1, n):
    dp[i] = max(a[i], dp[i-1]+a[i])

print(max(dp))
profile
배우고 싶은게 많은 개발자📚

0개의 댓글