python-algorithm

백준 15649 N과 M (1)

무적김두칠 2022. 1. 10. 11:59

1
2
3
4
5
from itertools import permutations
n,m =map(int,input().split())
p=permutations(range(1,n+1),m)
for i in p:
    print(" ".join(map(str,i)))
cs
반응형