n = int(input())
s = []
for i in range(n):
s.append(list(map(int, input().split())))
s.sort(key = lambda x : (x[1], x[0]))
for i in s:
print(i[0], i[1])
11650번에서 lambda x 이부분 순서만 바꾸면 된다
'알고리즘' 카테고리의 다른 글
<백준> 15829번 파이썬 알고리즘 (0) | 2021.07.13 |
---|---|
<백준> 11866번 파이썬 알고리즘 (0) | 2021.07.13 |
<백준> 11650번 파이썬 알고리즘 (0) | 2021.07.12 |
<백준> 11050번 파이썬 알고리즘 (0) | 2021.07.12 |
<백준> 10989번 파이썬 알고리즘 (0) | 2021.07.12 |