https://www.acmicpc.net/problem/5635
5635번: 생일
어떤 반에 있는 학생들의 생일이 주어졌을 때, 가장 나이가 적은 사람과 가장 많은 사람을 구하는 프로그램을 작성하시오.
www.acmicpc.net
students = []
for i in range(int(input())):
name,day,month,year = input().rstrip().split()
day,month,year = map(int,(day,month,year))
students.append((year,month,day,name))
students.sort()
print(students[-1][3])
print(students[0][3])
두 가지의 for문과 continue를 이용한 첫 코드는 굉장히 무식하게 풀었다 생각해서...(...)버리기로
'백준' 카테고리의 다른 글
백준 154866. 퇴사 2 (0) | 2024.03.12 |
---|---|
백준 11659. 구간 합 구하기4 (0) | 2024.03.12 |
백준 12852. 1로 만들기2 (0) | 2024.03.10 |
백준 11726. 2xn 타일링 (0) | 2024.03.10 |
백준 1149. RGB거리 (0) | 2024.03.10 |