일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 순열
- Combination
- 뒤로가기
- 괄호
- LCS
- 파이썬
- 6603
- expo
- 백준
- 안드로이드
- 매일11시
- permutation
- 11053
- 9095
- 11057
- Kotlin
- 코틀린
- 앱
- 11기
- itertools
- Android
- 홈화면
- 1182
- 나머지
- 최소공배수
- Python
- 코테
- lcm
- 11054
- 1260
- Today
- Total
목록분류 전체보기 (181)
황소개발자
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) 마지막 문제 뿌셧다
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] != anse..
n, m = map(int, input().split()) num_list = list(map(int, input().split())) num_list.sort() anses = [] a = [0 for i in range(m)] def go(idx, selected, n, m): if selected == m: if a not in anses: anses.append(a.copy()) return if idx == n: return a[selected] = num_list[idx] go(idx + 1, selected + 1, n, m) a[selected] = 0 go(idx + 1, selected, n, m) go(0, 0, n, m) for ans in anses: print(' '.join(m..
n, m = map(int, input().split()) num_list = list(map(int, input().split())) num_list.sort() a = [0 for i in range(m)] c = [False for i in range(n)] ans = [] def go(idx, n, m): if idx == m: ans.append(a.copy()) return for i in range(n): if c[i] == False: c[i] = True a[idx] = num_list[i] go(idx + 1, n, m) c[i] = False go(0, n, m) ans.sort() print(' '.join(map(str, ans[0]))) for i in range(1, len(a..
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)
n, m = map(int, input().split()) num_list = list(map(int, input().split())) num_list.sort() a = [0 for i in range(m)] c = [False for i in range(n)] def go(idx, n, m): if idx == m: print(' '.join(map(str, a))) return for i in range(n): a[idx] = num_list[i] go(idx + 1, n, m) # a[selected] = num_list[idx] # go(idx, selected + 1, n, m) # a[selected] = 0 # go(idx + 1, selected, n, m) go(0, n, m)
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 + 1, selected + 1, n, m) a[selected] = 0 go(idx + 1, selected, n, m) go(0, 0, n, m)
n, m = map(int, input().split()) num_list = list(map(int, input().split())) num_list.sort() a = [0 for i in range(m)] c = [False for i in range(n)] def go(selected, n, m): if selected == m: print(' '.join(map(str, a))) return for i in range(n): if c[i] == False: c[i] = True a[selected] = num_list[i] go(selected + 1, n, m) c[i] = False # a[selected] = num_list[idx] # go(idx + 1, selected + 1, n, ..