본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#317 백준 파이썬 [10974] 모든 순열

https://www.acmicpc.net/problem/10974

 

PYTHON CODE

from itertools import permutations #순열 함수

N = int(input())
N_list = [i for i in range(1, N+1)]

for numbers in list(permutations(N_list)):
    for num in numbers:
        print(num, end=' ')
    print()