Last active
December 23, 2022 11:18
-
-
Save modos/8c1f9a0c360aeb0ead79c4586f93500f to your computer and use it in GitHub Desktop.
فرزاد کارکن
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
a = int(input()) | |
b = [int(t) for t in input().split()] | |
if max(b) <= 0: | |
print(0) | |
else: | |
h = [max(b)] | |
for i in range(2, a): | |
for j in range(0, (a - (i)) + 1): | |
h.append(numpy.sum([b[k] for k in range(j, j + i)])) | |
print(max(h)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment