์•Œ๊ณ ๋ฆฌ์ฆ˜

๋ฐฑ์ค€ 11650 ์ขŒํ‘œ์ •๋ ฌ ๋ฌธ์ œํ’€์ด

ghtis1798 2021. 3. 24. 12:33

๐Ÿ“Œ๋ฌธ์ œ์„ค๋ช…

๋ฌธ์ œ ์„ค๋ช…
์ž…์ถœ๋ ฅ ์˜ˆ์‹œ

๐Ÿ“Œ๋ฌธ์ œ์ ‘๊ทผ๋ฐฉ์‹

์ •๋ ฌ ๋ฌธ์ œ์˜€๊ณ , ๊ธฐ์กด์— ํ’€์—ˆ๋˜ ๋ฌธ์ œ๋“ค์ฒ˜๋Ÿผ ๊ธฐ์ค€์„ 2๊ฐœ๋กœ ์„ค์ •ํ•˜๋ฉด ๋˜๋Š” ๋ฌธ์ œ์˜€๋‹ค.

x ์ขŒํ‘œ ๋น„๊ต ํ›„ ๊ฐ™๋‹ค๋ฉด y ์ขŒํ‘œ๋ฅผ ์ •๋ ฌํ–ˆ๋‹ค.

๐Ÿ“Œ๋ฌธ์ œํ’€์ด

์†Œ์Šค์ฝ”๋“œ

import sys

n = int(input())
locations = [list(map(int,sys.stdin.readline().rstrip().split())) for x in range(n)]

locations.sort(key = lambda location : (location[0], location[1]))

for x in locations:
    print(x[0], x[1])