题目描述
You are given a positive number N. Using the concept of Sieve, compute its prime factorisation.
Example:
Input:
N = 12246
Output:
2 3 13 157
Explanation:
2313*157 = 12246 = N.
Your Task:
Comple the function findPrimeFactors(), which takes a positive number N as input and returns a vector consisting of prime factors. You should implement Sieve algorithm to solve this problem.
Expected Time Complexity: O(Nlog(log(N)).
Expected Auxiliary Space: O(N).
Constraints:
1<=N<=2*10^{5}
输入格式
见题面
输出格式
见题面
样例输入
N = 12246
样例输出
2 3 13 157