euler/python/e099.py

26 lines
496 B
Python
Raw Normal View History

import math
2021-04-19 15:06:06 +02:00
def exp_log(base, power):
return power * math.log(base)
def read_exps():
with open("../txt/e099.txt", "r") as f:
return [(exp_log(int(s[0]), int(s[1])), i + 1)
for i, line in enumerate(f.readlines())
if (s := line.split(","))]
2021-04-19 15:06:06 +02:00
def euler_099():
exps = read_exps()
exps.sort()
return exps[-1][1]
2021-04-19 15:06:06 +02:00
if __name__ == "__main__":
solution = euler_099()
print("e099.py: " + str(solution))
assert(solution == 709)