문제 링크
정답 코드
# 6603번: 로또
import sys
def func(select):
if len(select) == 6:
print(*select)
return
for i in range(1, len(s)):
if s[i] not in select and select[-1] <= s[i]:
select.append(s[i])
func(select)
select.pop()
while True:
s = sys.stdin.readline().rstrip()
if s == '0':
break
s = list(map(int, s.split()))
k = s[0]
s = s[1:]
for i in range(k-5):
func([s[i]])
print('')
'알고리즘 > 백준' 카테고리의 다른 글
[백준 알고리즘] N과 M (11) (Python / 파이썬) (0) | 2024.01.28 |
---|---|
[백준 알고리즘] 1759번: 암호 만들기 (Python / 파이썬) (2) | 2024.01.25 |
[백준 알고리즘] 1182번: 부분수열의 합 (Python / 파이썬) (0) | 2024.01.24 |
[백준 알고리즘] 15649번: N과 M(1) (Python / 파이썬) (0) | 2024.01.24 |
[백준 알고리즘] 7569번: 토마토 (Python / 파이썬) (0) | 2024.01.22 |