알고리즘/DFS | BFS
파이썬 | 백준 | 6603 | 로또 | 조합(combinations)
cha-n
2020. 8. 14. 13:56
solution
1. K개 중 6개 → 조합 from itertools import combinations
# 6603, 로또
import sys
from itertools import combinations
lot = []
while True:
lot = list(map(int, sys.stdin.readline().split()))
if lot[0] == 0 and len(lot) == 1: # 0이면 실행 종료
break
lot_com = list(combinations(lot[1:], 6)) # 6개 뽑음
for lot_com_ in lot_com:
print(*lot_com_)
print()
29380KB
64ms
문제 출처 https://www.acmicpc.net/problem/6603