일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- Machine learning
- BOJ
- c++
- 큐
- 백준
- mysql
- TensorFlow
- sort
- CSAP
- softmax
- 정렬
- stl
- PIR
- Neural Network
- 모두를 위한 머신러닝
- 한화오션
- deque
- DFS
- Programmers
- sung kim
- 모두를 위한 딥러닝
- 시간초과
- join
- SQL
- Linear Regression
- ML
- 프로그래머스
- deep learning
- Queue
- 알고리즘 고득점 kit
Archives
- Today
- Total
hello, world!
[baekJoon10816] 나이순 정렬 본문
https://www.acmicpc.net/problem/10814
10814번: 나이순 정렬
온라인 저지에 가입한 사람들의 나이와 이름이 가입한 순서대로 주어진다. 이때, 회원들을 나이가 증가하는 순으로, 나이가 같으면 먼저 가입한 사람이 앞에 오는 순서로 정렬하는 프로그램을
www.acmicpc.net
import sys
from itertools import combinations
# sys.stdin.readline()
n = int(sys.stdin.readline())
p = []
while n:
n -= 1
p.append(sys.stdin.readline().split())
p = list([int(i[0]), i[1], idx] for idx, i in enumerate(p))
p.sort(key = lambda x : (x[0], x[2]))
for j in list([i[0], i[1]] for i in p):
print(str(j[0]) + ' ' + j[1])
'BAEKJOON > sorting' 카테고리의 다른 글
[baekJoon10867] 중복 빼고 정렬하기 (0) | 2023.10.24 |
---|---|
[baekJoon11651] 좌표 정렬하기 2 (0) | 2023.10.24 |
[baekJoon11650] 좌표 정렬하기(pair 정리) (0) | 2020.08.04 |
[baekJoon3047] ABC (0) | 2020.08.03 |
[baekJoon16212] 정열적인 정렬 (2) | 2020.07.31 |
Comments