This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2025-11-19 10:19:23 +05:00
parent 38faab75b2
commit 55f7a49064
4 changed files with 43 additions and 6 deletions

27
24.7.py Normal file
View File

@@ -0,0 +1,27 @@
# import re
#
# with open('24_7.txt', 'r') as file:
# data = file.readline()
#
# data = re.sub('CD', '--', data)
#
# not_CD = r'(-?[^-]*)'
#
# CD_and_any = r'(?:--[^-]*){160}-?'
# la_CD_group = rf'(?=({CD_and_any}))'
#
# pattern = rf'{not_CD}{la_CD_group}'
#
# matches = re.findall(pattern, data)
#
# res = max([len(match[0] + match[1])
# for match in matches])
# print(res)
f = open('24_7.txt').readline()
f = f.replace('CD', 'C D').split()
m = 0
for i in range(len(f)-161):
a=''.join(f[i:i+161])
m = max(m, len(a))
print(m)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,14 @@
import math
a,b=map(int,input().split())
print(round(math.sqrt(a**2+b**2),2))
a1=int(input())
a=int(input())
if a==0:
a3=0
else:
a3=int(input())
s=0
while a3!=0:
if a1<a1 and a3<a1:
s+=1
a1=a
a=a3
a3=int(input())
print(s)