Осушитель

This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-11 23:51:46 +05:00
parent f28ef6205b
commit 62542328f4
3 changed files with 25 additions and 3 deletions

20
24.5.py
View File

@@ -1,5 +1,21 @@
import re
str1=open('24_5.txt').read()
result=re.split(r'(?<=P)P',str1)
str1=open('24_5.txt').read().strip('\n')
result=re.split(r'(?<=PP)',str1)
# result=re.split(r'P(?=P)',str1)
print(max(list(map(len,result))))
# f=open('24_5.txt')
# s=f.read().rstrip()
# k=1
# kmax=0
#
# for i in range(0, len(s)-1):
# if s[i]=='P' and s[i+1]=='P':
# k=1
# else:
# k=k+1
# kmax = max(k, kmax)
#
# print(kmax)

5
24.6.py Normal file
View File

@@ -0,0 +1,5 @@
import re
str1=open('24_6.txt').read().strip()
result=re.split(r'000+',str1)
print(max(list(map(len,result))))

1
24_6.txt Normal file

File diff suppressed because one or more lines are too long