

n,m = list(map(int,input().split()))
s = []
def dfs():
if len(s)==m:
print(' '.join(map(str,s)))
return
for i in range(1,n+1):
s.append(i)
dfs()
s.pop()
dfs()
N과 M (1) 문제의 정답 코드에서 조건문만 삭제해주었다.
| [파이썬/python] 백준 1259번 : 팰린드롬수 (🥉1) (0) | 2023.06.12 |
|---|---|
| [파이썬/python] 백준 15652번 : N과 M (4) (🥈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 |
| [파이썬/python] 백준 1436번 : 영화감독 숌 (🥈5) (0) | 2023.06.11 |