백준_11650 (좌표정렬하기_실버5_정렬_lambda_sort() 중요)

RostoryT·2022년 7월 22일
0

Sorting and Recursive

목록 보기
6/11

솔루션 코드 - 내가 품

  • 옛날에 푼적 있는듯?
  • sort와 람다 사용해야함
import sys

ans = []
for _ in range(int(sys.stdin.readline())):
    ans.append(list(map(int, sys.stdin.readline().split())))  
ans.sort(key = lambda x: (x[0], x[1]))

for i in ans:
    print(" ".join(map(str,i)))


profile
Do My Best

0개의 댓글