로마 숫자 만들기 (1) 썸네일형 리스트형 [ 백준 / BOJ ] 16922 로마 숫자 만들기 / 제출 1 / from itertools import combinations_with_replacement n = int(input()) count = [] opt = [1, 5, 10, 50] #for i in range(n+1): comb = list(combinations_with_replacement(opt, n)) comb = list(map(list, comb)) for c in comb: if sum(c) not in count: count.append(sum(c)) print(len(count)) 풀이 소요 시간: 22분 중간에 2번 정도 미끄러졌습니다. 1. 중복 조합으로 풀어야 하는데 조합으로 풀었습니다. 조합을 반복해서 카운트를 세면 된다고 생각했습니다. 이건 문제보다는 라이브러리를.. 이전 1 다음