이름:점수 쌍 여러 개가 콤마로 구분되어 입력됩니다. 점수 내림차순으로, 동점이면 이름 오름차순으로 출력하세요.
📥 테스트 입력값
Alice:85, Bob:85, Chris:92
🔎 실행 결과
Chris:92
Alice:85
Bob:85
💡 힌트 코치
sorted(..., key=lambda x: (-x[1], x[0])) 을 사용하세요.
✅ 정답 공개
data = []
for item in input().split(','):
k, v = item.strip().split(':')
data.append((k.strip(), int(v.strip())))
for name, score in sorted(data, key=lambda x: (-x[1], x[0])):
print(f'{name}:{score}')