백준 15649번 : N과 M (1)

상은·2022년 4월 14일
0

백준문제

목록 보기
8/12
n,m = map(int,input().split())
sol = []

def recur(cur):
    if cur == m :
        for i in sol:
            print(i, end=' ')
        print()
        return
    for i in range(1,n+1):
        if i not in sol:
            sol.append(i)
            recur(cur+1)
            sol.pop()
recur(0)
profile
Be the Best

0개의 댓글