题意:给你一个数,如果这个数是合数就输出它的最少因子
思路:套Pollard_rho算法模板
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
#define LL long long
#define MAX ((long long)1<<61)
LL factor[200],cnt;
LL mini;
LL gcd(LL a,LL b) {
return (b==0)?a:gcd(b,a%b);
}
LL Mulmod(LL a,LL b,LL n) {
LL exp = a%n, res = 0;
while(b) {
if(b&1) {
res+=exp;
if(res>n) res-=n;
}
exp <<= 1;
if(exp>n)
exp-=n;
b>>=1;
}
return res;
}
LL exp_mod(LL a,LL b,LL c){
LL k = 1;
while(b