scripts/ege/Вариант 2023 № 1/24.py
2023-05-05 00:45:01 +03:00

21 lines
354 B
Python
Vendored

with open("24.txt") as f:
data = f.read()
sgl = "CDF"
gl = "AO"
mx = 0
n = 0
for xr in range(3):
for i in range(xr, len(data) - 2, 3):
i1 = data[i]
i3 = data[i + 2]
if i1 in sgl and i3 in gl:
n += 1
else:
if n > mx:
mx = n
n = 0
print(mx)