This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-19 13:59:19 +05:00
parent 55f7a49064
commit 675fa882e0

21
24.7.py
View File

@@ -17,11 +17,18 @@
# res = max([len(match[0] + match[1]) # res = max([len(match[0] + match[1])
# for match in matches]) # for match in matches])
# print(res) # print(res)
from itertools import count
f = open('24_7.txt').readline()
f = f.replace('CD', 'C D').split() f = open('24_7.txt').read()
m = 0 a=[]
for i in range(len(f)-161): j=0
a=''.join(f[i:i+161]) count = 0
m = max(m, len(a)) for i in range(len(f)-1):
print(m) if f[i]+f[i+1]=='CD':
count+=1
if count>160:
count=1
a.append(i+1-j)
j=i
print(max(a))