You are viewing a single comment's thread. Return to all comments →
from math import inf
if name == 'main': arr = {} lowest = second = inf for _ in range(int(input())): name = input() score = float(input())
arr[score] = arr.get(score, []) + [name] if score < lowest: second = lowest lowest = score elif score < second and score > lowest: second = score print('\n'.join(sorted(arr[second])))
Seems like cookies are disabled on this browser, please enable them to open this website
Nested Lists
You are viewing a single comment's thread. Return to all comments →
from math import inf
if name == 'main': arr = {} lowest = second = inf for _ in range(int(input())): name = input() score = float(input())