๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โญ Problem_Solving/๋ฐฑ์ค€

[๋ฐฑ์ค€] 5635 ์ƒ์ผ (Python/ํŒŒ์ด์ฌ)

by ํฌ์ŠคํŠธ์‰์ดํฌ 2022. 12. 18.

<๋ฌธ์ œ๋งํฌ>

https://www.acmicpc.net/problem/5635

 

5635๋ฒˆ: ์ƒ์ผ

์–ด๋–ค ๋ฐ˜์— ์žˆ๋Š” ํ•™์ƒ๋“ค์˜ ์ƒ์ผ์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, ๊ฐ€์žฅ ๋‚˜์ด๊ฐ€ ์ ์€ ์‚ฌ๋žŒ๊ณผ ๊ฐ€์žฅ ๋งŽ์€ ์‚ฌ๋žŒ์„ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

www.acmicpc.net

 

<ํ’€์ด ์ „๋žต>

input์„ ์ž…๋ ฅ ๋ฐ›๊ณ  ์—ฐ-์›”-์ผ ์ˆœ์œผ๋กœ ์ •๋ ฌํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

 

<์ •๋‹ต ์ฝ”๋“œ>

# 221218 5635 ์ƒ์ผ

# ์ •๋‹ต์ฝ”๋“œ

N = int(input())

students = [input().split() for _ in range(N)]

students.sort(key=lambda x: (int(x[3]), int(x[2]), int(x[1])))

print(students[-1][0])
print(students[0][0])

๋Œ“๊ธ€