-
[복습] 15649 n과 m 1코테 대비 python/백준 2023. 4. 17. 23:02
백트레킹은 어렵다리;
n,m = map(int, input().split()) result = [] def dfs(): if len(result)==m: print(' '.join(map(str,result))) return for i in range(1,n+1): if i not in result: result.append(i) dfs() result.pop() dfs()
'코테 대비 python > 백준' 카테고리의 다른 글
15657 n과 m (8) (0) 2023.05.03 백준 2615 오목 (0) 2023.04.21 [복습] 14502 연구소 (0) 2023.04.17 18115 카드 놓기 (0) 2023.04.16 2580 스도쿠 (0) 2023.04.14