You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
516 B
31 lines
516 B
#!/usr/bin/env python3
|
|
|
|
# 99920044 instead of 2020 for bigboy
|
|
# p1: 134283487359328
|
|
# p2: 1655132197274893972
|
|
|
|
from sys import argv
|
|
|
|
i = [int(x) for x in open(argv[1])]
|
|
|
|
for x in i:
|
|
for y in i:
|
|
if x+y == 2020:
|
|
print(x*y)
|
|
break
|
|
else:
|
|
continue
|
|
break
|
|
|
|
for x in i:
|
|
for y in i:
|
|
for z in i:
|
|
if x+y+z == 2020:
|
|
print(x*y*z)
|
|
break
|
|
else:
|
|
continue
|
|
break
|
|
else:
|
|
continue
|
|
break
|
|
|