백준[ALGORITHM] - 좌표 정렬하기 (11650)
2024. 7. 18. 18:35ㆍ코딩/백준 [ALGORITHM]
반응형
n = int(input())
temp = {}
for _ in range(n):
x, y = map(int, input().split())
if x not in temp:
temp[x] = [y]
else:
temp[x].append(y)
for key in temp:
temp[key].sort()
sorted_temp = {k: temp[k] for k in sorted(temp)}
for key, value in sorted_temp.items():
for i in range(len(value)):
print(key, value[i])
반응형
'코딩 > 백준 [ALGORITHM]' 카테고리의 다른 글
백준 [ALGORITHM] - ROT13 (4446) (0) | 2024.09.09 |
---|---|
백준[ALGORITHM] - 럭비 클럽 (2083) (0) | 2024.08.04 |
백준 [ALGORITHM] - 블랙잭 (2798) (0) | 2024.07.04 |
백준 [ALGORITHM] - 세로 읽기 (10798) (0) | 2024.07.02 |
백준 [ALGORITHM] - 수 찾기 (1920) (1) | 2024.06.13 |