뚜루리 2024. 10. 14. 00:00
728x90
320x100

 

구현

N = int(input())
arr = [list(map(int, input().split())) for _ in range(N)]

arr = sorted(arr)
for x, y in arr:
	print(x, y)
  • sorted() 즉 정렬 알고리즘을 활용.

 

풀이

arr = [list(map(int, input().split())) for _ in range(N)]
# [[3, 4], [1, 1], [1, -1], [2, 2], [3, 3]]
  • arr은 위와 같이 출력된다.
728x90
320x100