mfgnik

Untitled

May 27th, 2020
831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. length = int(input())
  2. amount = int(input())
  3. last = -3
  4. need = 0
  5. for index in range(amount):
  6.     broken = int(input())
  7.     if broken and index - last >= length:
  8.         need += 1
  9.         last = index
  10. print(need)
Advertisement
Add Comment
Please, Sign In to add comment