지나가던 개발자
[Python] 백준 14382번(숫자세는 양 (Large)) 문제 풀이 본문
import sys
for i in range(int(sys.stdin.readline())):
n = int(sys.stdin.readline())
if n == 0:
print("Case #"+str(i+1)+": INSOMNIA")
continue
j = 1
s = []
while True:
for k in set(str(n*j)):
if int(k) not in s:
s.append(int(k))
if 0 in s and 1 in s and 2 in s and 3 in s and 4 in s and 5 in s and 6 in s and 7 in s and 8 in s and 9 in s:
print("Case #"+str(i+1)+": "+str(n*j))
break
j += 1
'PS > Python' 카테고리의 다른 글
[Python] 백준 17478번(재귀함수가 뭔가요?) 문제 풀이 (0) | 2022.12.01 |
---|---|
[Python] 백준 7568번(덩치) 문제 풀이 (0) | 2022.12.01 |
[Python] 백준 24039번(2021은 무엇이 특별할까?) 문제 풀이 (0) | 2022.11.27 |
[Python] 백준 21920번(서로소 평균) 문제 풀이 (0) | 2022.11.26 |
[Python] 백준 5939번(Race Results) 문제 풀이 (0) | 2022.11.24 |
Comments