본문 바로가기
개발 노트/알고리즘 문제

백준 6603 로또 (실버 2)

by LeeInGyu 2025. 5. 13.

백준 6603 로또 (실버 2)

링크: 6603 로또


접근 방법

  • 조합을 출력하는 문제로, 6개의 조합을 combinations로 출력한다.

소스 코드

소스 코드: 구현 소스 코드

import sys
from itertools import combinations

input = sys.stdin.readline

while True:
    input_str = list(map(int, input().split()))

    if input_str[0] == 0:
        break

    k = input_str[0]
    S = input_str[1:]

    for comb in combinations(S, 6):
        print(*comb)

    print()

코드 개선 사항(GPT 4o)

  • 없다.

결론

  • 문제를 너무 쉽게 풀어서 멍청이가 된 것 같다.
  • 이거 구현하는 방법을 공부해둬야할 것 같다.