[백준] 6603번 로또

거북이·2023년 1월 27일
0

백준[실버2]

목록 보기
28/81
post-thumbnail

💡문제접근

  • combinations을 이용해서 문제를 해결할 수 있었다.

💡코드(메모리 : 30616KB, 시간 : 44ms)

from itertools import combinations

import sys
input = sys.stdin.readline

while True:
    lotto = list(map(int, input().split()))
    if lotto == [0]:
        break
    lotto = lotto[1:]
    for i in combinations(lotto, 6):
        print(*i)
    print()

💡소요시간 : 5m

0개의 댓글