题解 | 分解质因数-不能用埃氏筛,只能用试除法
分解质因数
https://www.nowcoder.com/practice/35723516d6f841ca8869ecbcf3ddacaf
import re
import sys
def solve():
input = sys.stdin.readline
n = int(input())
res = []
while n % 2 == 0:
res.append(2)
n //= 2
i = 3
while True:
while n % i == 0:
res.append(i)
n //= i
i += 1
if i >= n:
if n >= 2:
res.append(n)
break
print(*res)
solve()

