4495: Least Prime factor
时间限制(普通/Java):3000MS/9000MS运行内存限制:65536KByte
总提交: 38 测试通过:3
描述
Findthe N-th smallest positive integer whose least prime factor is P.
输入
Theinput case has one line containing two integers N and P (1 ≤ N, P ≤ 109).P is a prime number.
输出
Outputthe expected result in one line. If the result is larger than 109,just output 0.
样例输入
1 2
样例输出

该问题要求找到最小质因子为P的第N个正整数,其中P是一个质数,且N和P的范围在1到10^9之间。解决方案可能涉及到容斥原理、二分查找或暴力计算。
最低0.47元/天 解锁文章
2236

被折叠的 条评论
为什么被折叠?



