n = int(input())
s = []
for i in range(n):
s.append(list(map(int, input().split())))
s.sort(key = lambda x : (x[0], x[1]))
for i in s:
print(i[0], i[1])
[]에 리스트를 삽입한다.
그리고 x[0] -> x[1] 순으로 정렬한다
'알고리즘' 카테고리의 다른 글
<백준> 11866번 파이썬 알고리즘 (0) | 2021.07.13 |
---|---|
<백준> 11651번 파이썬 알고리즘 (0) | 2021.07.12 |
<백준> 11050번 파이썬 알고리즘 (0) | 2021.07.12 |
<백준> 10989번 파이썬 알고리즘 (0) | 2021.07.12 |
<백준> 10845번 파이썬 알고리즘 (0) | 2021.07.11 |