Форум » Обработка символьных строк » 24 задача №4420 » Ответить

24 задача №4420

Leonid: Здравствуйте , задача №4420 , Не могу понять в чем ошибка ,Не сходится с ответом.Подскажите пожалуйста/ def proverka(x,y,z): x = abs(x) == x and len(str(x)) == 3 and x%2 != 0 y = abs(y) == y and len(str(y)) == 3 and y % 2 != 0 z = abs(z) == z and len(str(z)) == 3 and x % 2 != 0 return [x,y,z] pd = list(map(int,open(file="rre").read().split())) lst = list(filter(lambda x: x if proverka(x[0],x[1],x[2]) == [False,True,False] else None ,zip(pd,pd[1:],pd[2:]))) print(lst) print(len(lst),max(list(map(lambda x: sum(x), lst))))

Ответов - 1

timsc1: [pre2] def nech(n): return 100<=n<=999 and n%2!=0 mass=[int(x) for x in open('17-199.txt')] mm=[] for i in range(len(mass)-2): if nech(mass[i+1]) and not nech(mass[ i])and not nech(mass[i+2]): mm.append(mass[ i]+mass[i+1]+mass[i+2]) print(len(mm),max(mm))[/pre2]



полная версия страницы