[백준 1015][Python] 수열 정리

봉글렛·2023년 1월 20일

백준

목록 보기
39/55

문제 링크 https://www.acmicpc.net/problem/1015

순서를 정리해서 변환한 곳은 0으로 변경

실버 4단계 시작...

풀이

n = int(input())
result = []
t = [*map(int, input().split())]
s_t = sorted(t)
for i in range(n):
    no = s_t.index(t[i])
    result.append(no)
    s_t[no] = 0
print(*result)
profile
어쩌다 개발자 (할 수 있을 때까지!!!!)

0개의 댓글