일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Kotlin
- permutation
- 매일11시
- lcm
- 1260
- itertools
- 11053
- Python
- Android
- expo
- 코틀린
- 6603
- 괄호
- LCS
- 홈화면
- 앱
- 11기
- 코테
- 백준
- 뒤로가기
- 최소공배수
- 파이썬
- 1182
- 11057
- 11054
- 9095
- 순열
- 나머지
- Combination
- 안드로이드
Archives
- Today
- Total
목록15650 (1)
황소개발자
백준 15650 파이썬 python : N과 M (2) @@황소처럼 우직하게@@ 아아
n, m = map(int, input().split()) subs = [0 for i in range(m)] def go(idx, selected, n, m): # 길이 채워지면 종료 if selected == m: print(' '.join(map(str, subs))) return # n 초과하면 정수 범위 벗어나는거니까 종료 if idx > n: return # 그 idx를 선택한다면 subs에 넣기 subs[selected] = idx go(idx + 1, selected + 1, n, m) # 그 idx를 선택하지 않았을 때 subs[selected] = 0 go(idx + 1, selected, n, m) go(1, 0, n, m) 빨리 깨닫고 싶다
백준 문제 풀이
2020. 3. 1. 22:21