Toggle navigation
YouTube
Facebook
Telegram
english
english
українська
Algotester 4.3
Build 496
2024-10-17
Log In
Contact Us
College
Sponsors
Donate
Sources
Python 3
n = int(input()) a = [int(x) for x in input().split()] a += a pos = [] for i, x in enumerate(a): if x == 1: pos += [i] mx = 0 for i in range(len(pos) - 1): mx = max(mx, (pos[i + 1] - pos[i]) // 2) print(mx)