[백준] 15649번 N과 M (1)
June 20, 2022
import sys
N, M = map(int, sys.stdin.readline().split())
def combination(com:list):
if len(com) == M:
print(' '.join(map(str, com)))
return
for i in range(1, N + 1):
if i in com:
continue
combination(com + [i])
combination([])