N = int(input()) if N == 1:
exit(0)
bacteria = [0] * N
for i in range(0, N):
bacteria[i] = int(input())
prefix_sum = [bacteria[0]] * N
for i in range(1, N):
prefix_sum[i] = prefix_sum[i - 1] + bacteria[i]
ans = [0] * N
if bacteria[N-1] > bacteria[0]:
ans[N - 1] = 1
for i in reversed(range(2, N)):
if ans[i] == 1:
prev = i - 1
if prefix_sum[prev] > bacteria[i] and bacteria[0] < bacteria[prev]:
ans[prev] = 1
for i in range(N):
print(ans[i])

набираю 90 что не так до 100 доделать

Havedid Havedid    1   30.10.2020 08:55    0

Другие вопросы по теме Информатика