python
This commit is contained in:
12
17.py
Normal file
12
17.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
b=ma=0
|
||||||
|
f=open('17_1.txt')
|
||||||
|
mi=10**10
|
||||||
|
o=[int(i) for i in f]
|
||||||
|
for i in range(len(o)):
|
||||||
|
if abs(o[i])%10==6:
|
||||||
|
mi=min(mi,o[i])
|
||||||
|
for i in range(len(o)-1):
|
||||||
|
if ((abs(o[i])%10==6 and abs(o[i+1])%10!=6) or (abs(o[i])%10!=6 and abs(o[i+1])%10==6)) and (o[i]**2+o[i+1]**2)< mi**2:
|
||||||
|
b+=1
|
||||||
|
ma=max(ma,(o[i]**2+o[i+1]**2))
|
||||||
|
print(b,ma)
|
||||||
Reference in New Issue
Block a user