반응형

Prob


Approach

itertools를 사용한다.


Code

from itertools import permutations

N, M = map(int, input().split())

aws = permutations(list(range(1, N + 1)), M)
for i in aws:
    print(' '.join(map(str, i)))

 

출처

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

반응형
블로그 이미지

Refrin

일상생활 끄적 IT 프로젝트 끄적