[백준] 10974번 모든 순열

거북이·2023년 1월 19일
0

백준[실버3]

목록 보기
21/92
post-thumbnail

💡문제접근

permutations을 이용해서 간단히 해결할 수 있었던 문제였다.

💡코드(메모리 : 30616KB, 시간 : 144ms)

from itertools import permutations

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

for i in permutations(arr, N):
    print(*i)

💡소요시간 : 1m

0개의 댓글