๋ฌธ์
https://www.acmicpc.net/problem/15649
ํ์ด
# ๋ฐฑ์ค 15649๋ฒ ๋ฌธ์ - N๊ณผ M(1)
n, m = map(int, input().split())
s = []
def solution():
if len(s) == m:
print(' '.join(map(str, s)))
return
for i in range(1, n+1):
if i in s:
continue
s.append(i)
solution()
s.pop()
solution()
'๐๏ธ Algorithm > ๐ฉ ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค] [Python] 1912๋ฒ_์ฐ์ํฉ_๋์ ํ๋ก๊ทธ๋๋ฐ (0) | 2022.09.16 |
---|---|
[๋ฐฑ์ค] [Python] 1904๋ฒ_01ํ์ผ_๋์ ํ๋ก๊ทธ๋๋ฐ (0) | 2022.09.16 |
[๋ฐฑ์ค] [Python] 10845๋ฒ_ํ (0) | 2022.03.24 |
[๋ฐฑ์ค] [Python] 1920๋ฒ_์ ์ฐพ๊ธฐ (0) | 2022.03.19 |
[๋ฐฑ์ค] [Python] 7568๋ฒ_๋ฉ์น (0) | 2022.03.18 |