Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(a, b, c):
- B = [a, b, c]
- count = 0
- for i in range(len(B)):
- if str(B[i])[:1] == '6':
- count += 1
- return count
- file = open('17_11460.txt')
- A = list(map(int, file.readlines()))
- Max8 = -10**9
- count = 0
- Min = 10**10
- for i in range(len(A)):
- if str(A[i])[:1] == '8':
- Max8 = max(Max8, A[i])
- for i in range(2, len(A)):
- if f(A[i], A[i-1], A[i-2]) <= 1 and A[i] + A[i-1] + A[i-1] >= Max8:
- count += 1
- Min = min(Min, A[i] + A[i-1] + A[i-1])
- print(count, Min)
Advertisement
Add Comment
Please, Sign In to add comment