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