

n,m = list(map(int,input().split()))
s = []
def dfs(ss):
if len(s)==m:
print(' '.join(map(str,s)))
return
for i in range(ss,n+1):
s.append(i)
dfs(i)
s.pop()
dfs(1)
이전의 문제들처럼 어떤 조건이 필요하지 않는다.
| [파이썬/python] 백준 10824번 : 네 수 (🥉3) (1) | 2023.06.13 |
|---|---|
| [파이썬/python] 백준 1259번 : 팰린드롬수 (🥉1) (0) | 2023.06.12 |
| [파이썬/python] 백준 15651번 : N과 M (3) (🥈3) (0) | 2023.06.11 |
| [파이썬/python] 백준 15650번 : N과 M (2) (🥈3) (0) | 2023.06.11 |
| [파이썬/python] 백준 15649번 : N과 M (1) (🥈3) (0) | 2023.06.11 |