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