2017年8月16日

摘要: #include #include using namespace std; const int maxn=2,mod=1000000007; struct Matrix { long long mat[maxn][maxn]; Matrix operator*(const Matrix& m)const///重载*运算符,使其能进行矩阵相乘的运算 ... 阅读全文
posted @ 2017-08-16 11:33 sapphirebitter 阅读(252) 评论(0) 推荐(0)
 
摘要: 其中k为任意质因子,因为a的数值不确定,所有k的值可以任意选择。 以下代码用于求出m!: 阅读全文
posted @ 2017-08-16 10:45 sapphirebitter 阅读(617) 评论(0) 推荐(0)
 
摘要: LL Pollard_Rho(LL n, LL c) { LL x, y, d; LL i = 1, k = 2; x = y = rand() % n; do { i++; d = gcd(n + y - x, n); if(d > 1 && d = n) t = Pollard_Rho(n, ra... 阅读全文
posted @ 2017-08-16 10:09 sapphirebitter 阅读(307) 评论(0) 推荐(0)
 
摘要: #include using namespace std; /** //普通快速幂 LL pow_mod(LL a, LL x, LL p) { LL res = 1; while(x) { if (x & 1) res = (unsigned long long)res * a % p; x >>= 1; a = (unsign... 阅读全文
posted @ 2017-08-16 10:07 sapphirebitter 阅读(303) 评论(0) 推荐(0)
 
摘要: #include<bits/stdc++.h>包含了C++里面所有的库函数,因此在写任何程序的时候只需要加上#include<bits/stdc++.h>即可。 阅读全文
posted @ 2017-08-16 09:07 sapphirebitter 阅读(800) 评论(0) 推荐(0)