백준. 18870번. 좌표 압축 파이썬 풀이
문제링크 https://www.acmicpc.net/problem/18870
딕셔너리를 이용하여 인덱스 저장
n = int(input())
array = list(map(int, input().split()))
temp = list(set(array))
temp = sorted(temp)
dic = {}
for i in range(len(temp)):
dic[temp[i]] = i
for point in array:
print(dic[point], end=' ')