Created
July 16, 2021 05:23
-
-
Save betaprojects/361befea535b7f715ac60f18475aef34 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 99 solution: Find the largest exponential among thousands of base/exponent pairs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import log | |
v = [] | |
for _ in range(int(input())): | |
b, e = map(int, input().split()) | |
v.append((e * log(b), b, e)) | |
k = int(input())-1 | |
b, e = sorted(v)[k][1:3] | |
print (b, e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment