-
[6603] 로또 (Python)[Python] 알고리즘/Silver 2022. 4. 4. 13:19
[문제]
https://www.acmicpc.net/problem/6603
알고리즘 분류는 수학, 조합론, 백트래킹, 재귀 입니다.
저는 python의 combinations를 이용하여 풀었습니다.
[코드]
from shlex import join import sys from itertools import combinations comb = list() while True: S = list(map(int, sys.stdin.readline().split())) if S[0] == 0: break comb.append(list(combinations(S[1:], 6))) for i in range(len(comb)): for j in comb[i]: print(' '.join([str(a) for a in j])) print()
'[Python] 알고리즘 > Silver' 카테고리의 다른 글
[10819] 차이를 최대로 (Python) (0) 2022.04.12 [1182] 부분수열의 합 (Python) (0) 2022.04.04 [1535] 안녕 (Python) (0) 2022.03.21 [1138] 한 줄로 서기 (Python) (0) 2022.03.18 [1411] 비슷한 단어 (Python) (0) 2022.03.01