문제 링크: https://www.acmicpc.net/problem/10974
백준 알고리즘 기초 2/2 520에서 3번째 - 10974번 모든 순열을 풀어보았다.
풀이:
파이썬은 permutation을 썼다.
C++
Python
from itertools import permutations
n=int(input())
arr=[i+1 for i in range(n)]
res=permutations(arr)
for i in res:
print(*i)
Java
'코테용 문제풀이 > 백준' 카테고리의 다른 글
외판원 순회 2 풀이 (0) | 2023.01.25 |
---|---|
차이를 최대로 풀이 (0) | 2023.01.25 |
이전 순열 풀이 (0) | 2023.01.25 |
다음 순열 풀이 (0) | 2023.01.25 |
N과 M (12) 풀이 (0) | 2023.01.25 |