소수, 약수 구하기_에라토스테네스의 체
n = 10 num = set(range(2, n+1)) for i in range(2, n+1): if i in num: num -= set(range(i*2,n+1,i)) print(num) 약수 개수 구하기 def solution(number, limit, power): # k = [1 for _ in range(number+1)] c = [0 for _ in range(number+1)] for i in range(number+1): if i == 0: continue for j in range(i,number+1,i): # k[j] *= i c[j] += 1 c = c[1:] answer = 0 for i in c: if i
2023.11.06