첨에 뭔말인지 이해를 못했다.

그냥 예제 케이스보고 순위 나타내라는 거구나 해서 풀어봤다.

리스트 컴프리핸션을 적극적으로 활용해 보았다.

 

import sys

def a():
    a=int(input())
    b=list(map(int,sys.stdin.readline().split()))
    c=list(sorted(set(b)))
    c={c[i]:i for i in range(len(c))}
    print(*[c[i] for i in b])
   
a()

'취준 > 백준' 카테고리의 다른 글

14889 - 파이썬  (0) 2022.05.02
14888 - 파이썬  (0) 2022.05.01
15650 - 파이썬  (0) 2022.04.05
15649 - 파이썬  (0) 2022.04.05
10814 - 파이썬  (0) 2022.04.04

+ Recent posts