Осушитель
This commit is contained in:
20
24.5.py
20
24.5.py
@@ -1,5 +1,21 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
str1=open('24_5.txt').read()
|
str1=open('24_5.txt').read().strip('\n')
|
||||||
result=re.split(r'(?<=P)P',str1)
|
result=re.split(r'(?<=PP)',str1)
|
||||||
|
# result=re.split(r'P(?=P)',str1)
|
||||||
print(max(list(map(len,result))))
|
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
5
24.6.py
Normal 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))))
|
||||||
Reference in New Issue
Block a user