๋ฌธ์
https://www.acmicpc.net/problem/15651
๋ด ๋ฌธ์ ํ์ด
n, m = map(int, input().split())
tmp = []
result = []
def dfs():
if len(tmp) == m:
print(' '.join(map(str, tmp)))
return
for i in range(1, n+1):
tmp.append(i)
dfs()
tmp.pop()
dfs()
๐ ๋ฐฑํธ๋ํน ๋ฌธ์ ! (https://seolhee2750.tistory.com/189 ์ฐธ๊ณ )
๐ก ํผ๋๋ฐฑ
- ๋ฐฑํธ๋ํน ์๊ณ ๋ฆฌ์ฆ ์ ์๊ณ ์์ผ๋ฉด ์ฝ๊ฒ ํ ์ ์๋ ๋ฌธ์ !
'4๏ธโฃ Python > Problem Solving' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python Algorithm] ๊ณตํต ๋ถ๋ถ ๋ฌธ์์ด BOJ #5582 (0) | 2022.05.24 |
---|---|
[Python Algorithm] N๊ณผ M (4) BOJ #15652 (0) | 2022.02.15 |
[Python Algorithm] N๊ณผ M (2) BOJ #15650 (0) | 2022.02.15 |
[Python Algorithm] N๊ณผ M (1) BOJ #15649 (0) | 2022.02.15 |
[Python Algorithm] Q-์ธ๋ฑ์ค BOJ #13333 (0) | 2022.02.10 |
๋๊ธ