MaxLenRep = int(input())
Len = int(input())
zabor = []
rem = 0
tl = 0
for i in range(Len):
zabor.append(int(input()))
for i in zabor:
if i == 1 and tl == 0:
rem += 1
tl = MaxLenRep
if tl > 0:
tl -= 1
print(rem)
Объяснение:
Питон
MaxLenRep = int(input())
Len = int(input())
zabor = []
rem = 0
tl = 0
for i in range(Len):
zabor.append(int(input()))
for i in zabor:
if i == 1 and tl == 0:
rem += 1
tl = MaxLenRep
if tl > 0:
tl -= 1
print(rem)
Объяснение:
Питон