Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open(r'17 (17).txt')
- a = list()
- for s in f:
- a.append(int(s))
- t = 0
- for el in a:
- if (el % 100) % 11 == 0:
- t = min(t, el)
- t = t**2
- c = 0
- mxs = 0
- for i in range(len(a) - 1):
- x = abs(a[i])
- y = abs(a[i+1])
- fl1 = ((x % 13 == 0) + (y % 13 == 0)) == 1
- fl2 = ((x % 10) == ((y % 100) // 10)) or ((y % 10) == ((x % 100) // 10))
- fl3 = x**2 + y**2 <= t
- if all([fl1, fl2, fl3]):
- c += 1
- mxs = max(mxs, x**2 + y**2)
- print(c, mxs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement