백준 1527 파이썬
(1) 처음 내 코드 -> 시간초과 a,b = map(int,input().split()) cnt = 0 s1="4" s2="7" for i in range(a,b+1): s = str(i) bool=True for j in s: if j==s1 or j==s2: continue else: bool=False break if bool==True: cnt+=1 print(cnt) 입력이 1보다 크고, 1,000,000,000보다 작거나 같은 자연수로, 코드 제출하기 버튼을 누르면서도 뭔가 시간초과가 날거 같았다. (2) 문제 해결 후 내 코드 -> product 사용 from itertools import product a,b = map(int,input().split()) cnt = 0 key = [] ..
2023. 1. 25.