MaxSubsum/muravitskaya41 | MaxSubsum/Bernard04 | ||||
---|---|---|---|---|---|
f | 1 | a = int(input()) | f | 1 | a = int(input()) |
n | n | 2 | |||
2 | ans = a | 3 | ans = a | ||
3 | sum = 0 | 4 | sum = 0 | ||
4 | 5 | ||||
n | 5 | while (a != 0): | n | 6 | while a != 0: |
6 | sum += a | 7 | sum += a | ||
7 | ans = max(ans, sum) | 8 | ans = max(ans, sum) | ||
8 | sum = max(sum, 0) | 9 | sum = max(sum, 0) | ||
t | t | 10 | |||
9 | a = int(input()) | 11 | a = int(input()) | ||
10 | 12 | ||||
11 | print(ans) | 13 | print(ans) | ||
12 | 14 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|