[Baekjoon] 1912 연속합 python

sorzzzzy·2021년 8월 4일
0

Baekjoon Algorithm

목록 보기
8/46
post-thumbnail

🏷 문제


💡 코드

n = int(input())
num_list = list(map(int, input().split()))

dp_table = [0] * (n+1)
dp_table[0] = num_list[0]
for i in range(1, n+1):
    dp_table[i] = max(dp_table[i-1] + num_list[i], num_list[i])

print(max(dp_table))

🔑

profile
Backend Developer

0개의 댓글