황소개발자
백준 15666 파이썬 python : N과 M (12) @@황소처럼 우직하게@@ 드디어 끝 본문
반응형
n, m = map(int, input().split())
num_list = list(map(int, input().split()))
num_list = list(set(num_list))
num_list.sort()
a = [0 for i in range(m)]
def go(idx, selected, m):
if selected == m:
print(' '.join(map(str, a)))
return
if idx == len(num_list):
return
a[selected] = num_list[idx]
go(idx, selected + 1, m)
a[selected] = 0
go(idx + 1, selected, m)
go(0, 0, m)
마지막 문제 뿌셧다
반응형
'백준 문제 풀이' 카테고리의 다른 글
백준 1260 파이썬 python : DFS와 BFS @@황소처럼 우직하게@@ 깔끔 숏코딩 (1) | 2020.03.02 |
---|---|
백준 13023 파이썬 python : ABCDE @@황소처럼 우직하게@@ DFS깔끔하네 (0) | 2020.03.02 |
백준 15665 파이썬 python : N과 M (11) @@황소처럼 우직하게@@ (0) | 2020.03.02 |
백준 15664 파이썬 python : N과 M (10) @@황소처럼 우직하게@@ 시간초과 안나넹 (0) | 2020.03.02 |
백준 15663 파이썬 python : N과 M (9) @@황소처럼 우직하게@@ (0) | 2020.03.02 |
Comments