일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- LCS
- 1182
- 11057
- permutation
- 11053
- Combination
- 코테
- 11기
- 순열
- 최소공배수
- Python
- expo
- 나머지
- 6603
- 파이썬
- 매일11시
- itertools
- lcm
- 9095
- 앱
- 괄호
- Android
- 11054
- 홈화면
- Kotlin
- 백준
- 1260
- 코틀린
- 안드로이드
- 뒤로가기
Archives
- Today
- Total
황소개발자
백준 15655 파이썬 python : N과 M (6) @@황소처럼 우직하게@@ 본문
반응형
n, m = map(int , input().split())
num_list = list(map(int, input().split()))
num_list.sort()
a = [0 for i in range(m)]
def go(idx, selected, n, m):
if selected == m:
print(' '.join(map(str, a)))
return
if idx == n:
return
a[selected] = num_list[idx]
go(idx + 1, selected + 1, n, m)
a[selected] = 0
go(idx + 1, selected, n, m)
go(0, 0, n, m)
반응형
'백준 문제 풀이' 카테고리의 다른 글
백준 15657 파이썬 python : N과 M (8) @@황소처럼 우직하게@@ (0) | 2020.03.02 |
---|---|
백준 15656 파이썬 python : N과 M (7) @@황소처럼 우직하게@@ (0) | 2020.03.02 |
백준 15654 파이썬 python : N과 M (5) @@황소처럼 우직하게@@ (0) | 2020.03.02 |
백준 15652 파이썬 python : N과 M (4) @@황소처럼 우직하게@@ (0) | 2020.03.01 |
백준 15651 파이썬 python : N과 M (3) @@황소처럼 우직하게@@ 할만하노 (0) | 2020.03.01 |
Comments