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