728x90
9838번: XMAS
Your program must write a mapping from the guests to the recipients of their gifts to the standard output. The first line contains an integer indicating the recipient of the gift brought by guest 1. Similarly, the second line contains an integer indicating
www.acmicpc.net
문제 풀이
입력된 값을 인덱스로, 들어온 순서를 값으로 정해준 뒤, 순서대로 출력해준다.
정답 코드
n = int(input())
lst = [0] * (n + 1)
for i in range(1, n + 1) :
lst[int(input())] = i
for i in range(1, n + 1) : print(lst[i])
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9907 - ID [python] (0) | 2023.03.28 |
---|---|
[BOJ/백준] 9848 - Gift [python] (0) | 2023.03.28 |
[BOJ/백준] 9783 - Easy Encryption [python] (0) | 2023.03.27 |
[BOJ/백준] 9776 - Max Volume [python] (0) | 2023.03.27 |
[BOJ/백준] 9773 - ID Key [python] (0) | 2023.03.27 |