itertools에 있는 permutation 함수를 사용하여 문제를 풀었더니 당연히 메모리 초과,,, 큽.. import itertools n = int(input()) array = list(map(int, input().split())) temp = list(itertools.permutations(range(1, n + 1), n)) # array[0] = 소문제 번호 if array[0] == 1: # k를 입력받음 -> array[1]에 있음 print(*temp[array[1] - 1]) else: # 임의의 순열을 나타내는 n개의 수를 입력받음 # array[1:n+1] print(temp.index(tuple(array[1:n + 1])) + 1) 직접 구현해야하나 고민했지만, 이것도 마..