## 문제
좌표를 정렬하는 y좌표를 우선순위로 두고 정렬하고, 그 다음 x좌표를 우선순위로 정렬해야한다.
그냥 x,y 바꿔서 y,x로 저장하고 정렬하고 출력할때 x,y 순서로 나오게 하면 된다.
## code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
input = sys.stdin.readlines() | |
n1 = list(map(lambda x : x.rstrip(),input)) | |
n2 = list(map(lambda x : x.replace('\x1a',''),n1)) | |
l = [] | |
for k in n2[1:]: | |
a = int(k.split()[0]) | |
b = int(k.split()[1]) | |
l += [[b,a]] | |
l.sort() | |
for tmp in l: | |
print(tmp[1],tmp[0]) |
..
0 댓글