Skip to content

Commit d6984de

Browse files
committed
[BOJ] #6603.로또 / 실버2 / 40(X)
1 parent 7fb2e1f commit d6984de

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import sys
2+
3+
def backtrack(S, path, start):
4+
if len(path) == 6:
5+
print(' '.join(map(str, path)))
6+
return
7+
for i in range(start, len(S)):
8+
path.append(S[i])
9+
backtrack(S, path, i + 1)
10+
path.pop()
11+
12+
lines = sys.stdin.read().splitlines()
13+
first_case = True
14+
15+
for line in lines:
16+
if line == '0':
17+
break
18+
19+
parts = list(map(int, line.strip().split()))
20+
S = parts[1:]
21+
22+
if not first_case:
23+
print()
24+
first_case = False
25+
26+
backtrack(S, [], 0)

0 commit comments

Comments
 (0)