Skip to content

Instantly share code, notes, and snippets.

@betaprojects
Created July 16, 2021 05:23
Show Gist options
  • Save betaprojects/361befea535b7f715ac60f18475aef34 to your computer and use it in GitHub Desktop.
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.
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