알고리즘
백준_BruteForce_로또
소소의
2019. 12. 28. 00:00
import numpy as np
def dfs(start, depth):
if depth == 6:
for i in combination:
print(i, end=' ')
print()
return
## 6개 다 안채워진 경우
for i in range(start, n):
combination[depth] = lotto[i]
dfs(i+1, depth+1)
while(1):
inp = input()
if inp == '0':
break
case = inp.split()
n = int(case[0])
lotto = [int(i) for i in case[1:]]
combination = np.zeros(6, dtype='int')
dfs(start=0, depth=0)
print()
python으로 작성한 코드입니다.
예제는 잘 돌아가나 런타임 에러가 나고 있어요.
고수님들 조언 부탁드립니다!!