less than 1 minute read

문제링크

람다 함수 사용, - 를 붙이면 Reverse = True

파이썬


import sys
input = sys.stdin.readline

n = int(input())
student = []
for i in range(n):
    a,b,c,d = list(map(str,input().split()))
    student.append([a,int(b),int(c),int(d)])
    
student.sort(key=lambda x: (-x[1], x[2],-x[3],x[0]))
for i in student:
    print(i[0]) 




카테고리:

업데이트:

댓글남기기