forked from ndb796/python-for-coding-test
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1.py
More file actions
19 lines (16 loc) ยท 695 Bytes
/
1.py
File metadata and controls
19 lines (16 loc) ยท 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
n = int(input())
students = [] # ํ์ ์ ๋ณด๋ฅผ ๋ด์ ๋ฆฌ์คํธ
# ๋ชจ๋ ํ์ ์ ๋ณด๋ฅผ ์
๋ ฅ ๋ฐ๊ธฐ
for _ in range(n):
students.append(input().split())
'''
[ ์ ๋ ฌ ๊ธฐ์ค ]
1) ๋ ๋ฒ์งธ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ
2) ๋ ๋ฒ์งธ ์์๊ฐ ๊ฐ์ ๊ฒฝ์ฐ, ์ธ ๋ฒ์งธ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก ์ค๋ฆ์ฐจ์ ์ ๋ ฌ
3) ์ธ ๋ฒ์งธ ์์๊ฐ ๊ฐ์ ๊ฒฝ์ฐ, ๋ค ๋ฒ์งธ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ด๋ฆผ์ฐจ์ ์ ๋ ฌ
4) ๋ค ๋ฒ์งธ ์์๊ฐ ๊ฐ์ ๊ฒฝ์ฐ, ์ฒซ ๋ฒ์งธ ์์๋ฅผ ๊ธฐ์ค์ผ๋ก ์ค๋ฆ์ฐจ์ ์ ๋ ฌ
'''
students.sort(key=lambda x: (-int(x[1]), int(x[2]), -int(x[3]), x[0]))
# ์ ๋ ฌ๋ ํ์ ์ ๋ณด์์ ์ด๋ฆ๋ง ์ถ๋ ฅ
for student in students:
print(student[0])