일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 1260
- 순열
- 매일11시
- itertools
- Kotlin
- 앱
- Python
- 코테
- 11053
- Android
- 11기
- expo
- 코틀린
- 안드로이드
- 1182
- 파이썬
- 11054
- Combination
- 괄호
- 11057
- permutation
- LCS
- 6603
- lcm
- 나머지
- 뒤로가기
- 9095
- 백준
- 최소공배수
- 홈화면
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