• Home
  • About
    • JOOS photo

      JOOS

      Joos's blog

    • Learn More
    • Email
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

[백준] 1912번 : 연속합 with python3

11 Sep 2018

Reading time ~1 minute

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

n = int(input())
nums = list(map(int, input().split()))
d = [0]*n

d[0] = nums[0]
for i in range(1, n):
    d[i] = nums[i]
    if d[i-1] + d[i] > d[i]:
        d[i] = d[i-1] + d[i]
print(max(d))


algorithm백준 Share Tweet +1