Prime Test
Time Limit: 6000MS | Memory Limit: 65536K | |
Total Submissions: 17747 | Accepted: 3644 | |
Case Time Limit: 4000MS |
Description
Given a big integer number, you are required to find out whether it's a prime number.
Input
The first line contains the number of test cases T (1 <= T <= 20 ), then the following T lines each contains an integer number N (2 <= N < 2
54).
Output
For each test case, if N is a prime number, output a line containing the word "Prime", otherwise, output a line containing the smallest prime factor of N.
Sample Input
2 5 10
Sample Output
Prime 2
这道题就是miiler_rabin素数测试和pollard_rho质因子分解的标准模板题。。。第一次做这样的题,这道题我是参照网上别人的代码写的,作为学习,当做模板学习了.....
代码:
语言:c++