목록15657 (1)
황소개발자
백준 15657 파이썬 python : N과 M (8) @@황소처럼 우직하게@@
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, selected + 1, n, m) a[selected] = 0 go(idx + 1, selected, n, m) go(0, 0, n, m)
백준 문제 풀이
2020. 3. 2. 01:34