일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 11053
- LCS
- 코테
- itertools
- 1260
- 홈화면
- 순열
- 매일11시
- 11054
- 나머지
- 6603
- expo
- 11057
- 9095
- 최소공배수
- 파이썬
- 백준
- Android
- Combination
- 괄호
- Python
- 코틀린
- lcm
- 1182
- 11기
- permutation
Archives
- Today
- Total
황소개발자
백준 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