Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 496
2024-10-17
Log In
Contact Us
College
Sponsors
Donate
Sources
Python 3
n = int(input()) s, mn, mx = (0, 0, 0) for a in map(int, input().split()): s += a mn = min(mn, s) mx = max(mx, s) print(mx - mn + min(mx, -mn))