지나가던 개발자
[Python] 백준 5635번(생일) 문제 풀이 본문
from datetime import datetime
youngest = ["", datetime.strptime("1990 01 01", "%Y %m %d")]
oldest = ["", datetime.strptime("2010 12 31", "%Y %m %d")]
for i in range(int(input())):
    nameAndBirth = input()
    name = nameAndBirth.split()[0]
    birth = datetime.strptime(" ".join(nameAndBirth.split()[1:]), "%d %m %Y")
    if birth <= oldest[1]:
        oldest[0] = name
        oldest[1] = birth
    if birth >= youngest[1]:
        youngest[0] = name
        youngest[1] = birth
        
print(youngest[0])
print(oldest[0])'PS > Python' 카테고리의 다른 글
| [Python] 백준 13706번(제곱근) 문제 풀이 (0) | 2022.11.16 | 
|---|---|
| [Python] 백준 25757번(임스와 함께하는 미니게임) 문제 풀이 (1) | 2022.11.15 | 
| [Python] 백준 4659번(비밀번호 발음하기) 문제 풀이 (0) | 2022.11.14 | 
| [Python] 백준 10821번(정수의 개수) 문제 풀이 (0) | 2022.11.14 | 
| [Python] 백준 12605번(단어순서 뒤집기) 문제 풀이 (0) | 2022.11.14 | 
			  Comments
			
		
	
               
           
					
					
					
					
					
					
				
 
								 
								 
								