본문 바로가기
알고리즘/백준

백준-11557번(Yangjojang of The Year)-python3

by nyeongha 2023. 11. 30.
for x in range(int(input())):
    dic={}
    for y in range(int(input())):
        a,b=input().split()
        dic[a]=int(b)
    b=sorted(dic.items(), key=lambda x: x[1], reverse=True)
    print(b[0][0])