작성
·
137
0
def DFS(idx):
global count
if idx == m:
for x in a:
print(x, end=' ')
count += 1
print()
else:
for i in range(1, n + 1):
if ch[i] == 0:
ch[i] = 1
a[idx] = i
Tree(idx + 1)
for j in range(i + 1, n + 1):
ch[j] = 0
n, m = map(int, input().split())
a = [0] * m
ch = [0] * (n + 1)
count = 0
DFS(0)
print(count)