본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 20124번 모르고리즘 회장님 추천 받습니다

by 현장 2022. 9. 2.

-Code

from sys import stdin
input = stdin.readline
arr = [list(input().split()) for _ in range(int(input()))]
arr.sort(key=lambda x: int(x[1]))
name = sorted([i for i, j in arr if int(j) == int(arr[-1][1])])
print(name[0])

문자도 정렬해야하는데 있는줄 모르고 하다가 틀렸습니다.