백준 33896번: 아깝게 놓친 COSS 장학금 #Python

ColorlessDia·2025년 11월 27일

algorithm/baekjoon

목록 보기
739/836
import sys

input = sys.stdin.readline

N = int(input())

scholarship_score_list = []

for _ in range(N):
    line = input().rstrip().split()
    name = line[0]
    score, risk, cost = map(int, line[1:])

    scholarship_score = int((score ** 3) / (cost * (risk + 1)))
    scholarship_score_list.append((name, scholarship_score, cost))

scholarship_score_list.sort(key=lambda x: (-x[1], x[2], x[0]))
scholarship_student = scholarship_score_list[1][0]

print(scholarship_student)

0개의 댓글