Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=48472
- data = open('24.txt').readline()
- gl = 'AO'
- sogl = 'CDF'
- cnt = 0 #длина текущей строки
- mx = 0 #ответ -- максимальная длина среди найденных
- for x in data: #x -- текущая буква
- if ((cnt % 3 == 0 or cnt % 3 == 1) and (x in gl)) or ((cnt % 3 == 2) and (x in sogl)):
- cnt += 1
- if (cnt // 3) > mx and cnt % 3 == 0:
- mx = cnt // 3
- else:
- cnt = 0
- print(mx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement