|
|
back to boardWA7 can't find my mistake python N = int(input()) p = [] maxi = 0 for i in range(N): p.append(int(input())) summi = sum(p) for i in range(N): fsummi = sum(p[i:len(p)-i-1]) if fsummi > maxi and fsummi>summi : maxi = fsummi maxi2 = 0 for i in range(0, N-1): nsummi = sum(p[i::]) jsummi=summi-nsummi if nsummi > jsummi: maxi2 = nsummi else: maxi2 = jsummi if maxi>maxi2: print(maxi) elif summi> maxi and summi>maxi2: print(summi) else: print(maxi2) |
|
|