Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Python
- misc
- Web
- 문자열
- CTF
- MySQL
- wargame
- Network
- Incognito
- HackCTF
- 써니나타스
- php
- Text
- 백준
- 그리디 알고리즘
- Digital Forensics
- 수학
- 구현
- N0Named
- 정렬
- Forensics
- C
- Web Hacking
- Database
- writeup
- SuNiNaTas
- xcz.kr
- 인코그니토
- 사칙연산
- cryptography
Archives
- Today
- Total
보안을 그리다, 훈이
[Baekjoon/Python3] 10814번 나이순 정렬 본문
[Baekjoon/Python3] 10814번 나이순 정렬
10814번: 나이순 정렬
온라인 저지에 가입한 사람들의 나이와 이름이 가입한 순서대로 주어진다. 이때, 회원들을 나이가 증가하는 순으로, 나이가 같으면 먼저 가입한 사람이 앞에 오는 순서로 정렬하는 프로그램을
www.acmicpc.net
n = int(input())
members = []
for i in range(n):
age, name = map(str, input().split())
age = int(age)
members.append((age, name))
members.sort(key = lambda member: (member[0])) # sort(key), ()
for member in members:
print(member[0], member[1])
'Programming > Python & Data Structures' 카테고리의 다른 글
[Baekjoon/Python3] 10818번 최소, 최대 (0) | 2020.12.06 |
---|---|
[Baekjoon/Python3] 10817번 세 수 (0) | 2020.12.06 |
[Baekjoon/Python3] 10813번 공 바꾸기 (0) | 2020.12.06 |
[Baekjoon/Python3] 10809번 알파벳 찾기 (0) | 2020.12.06 |
[Baekjoon/Python3] 10808번 알파벳 개수 (0) | 2020.12.06 |
Comments