728x90
반응형
순서에 맞게 줄을 세워주면 된다.
n = int(input())
li = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
cnt = 0
for j in range(n):
if ans[j] != 0 and i+1 > ans[j]:
continue
if cnt == li[i]:
ans[j] = i+1
break
cnt += 1
print(*ans)
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 1152번 단어의 개수(python) (0) | 2020.01.25 |
---|---|
백준 알고리즘 1145번 적어도 대부분의 배수(python) (0) | 2020.01.25 |
백준 알고리즘 1110번 더하기 사이클(python) (0) | 2020.01.24 |
백준 알고리즘 1100번 하얀 칸(python) (0) | 2020.01.24 |
백준 알고리즘 1094번 막대기(python) (0) | 2020.01.24 |