2021-04-22 20:55:46 +02:00
|
|
|
import math
|
2021-04-19 15:06:06 +02:00
|
|
|
|
|
|
|
|
2021-04-22 20:55:46 +02:00
|
|
|
def exp_log(base, power):
|
|
|
|
return power * math.log(base)
|
2021-04-22 04:08:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
def read_exps():
|
2021-04-22 21:17:19 +02:00
|
|
|
with open("../txt/e099.txt", "r") as f:
|
2021-04-22 20:55:46 +02:00
|
|
|
return [(exp_log(int(s[0]), int(s[1])), i + 1)
|
2021-04-22 04:08:47 +02:00
|
|
|
for i, line in enumerate(f.readlines())
|
|
|
|
if (s := line.split(","))]
|
2021-04-19 15:06:06 +02:00
|
|
|
|
|
|
|
|
2021-04-22 04:08:47 +02:00
|
|
|
def euler_099():
|
2021-04-22 20:55:46 +02:00
|
|
|
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))
|
2021-04-22 20:55:46 +02:00
|
|
|
assert(solution == 709)
|
2021-04-22 04:08:47 +02:00
|
|
|
|