摘要:
#include #include #include #include #include #define LL long long using namespace std; const int S=20;//随机算法判定次数,S越大,判错概率越小 LL ans; //给定一个数,判断是否是素数(常用long long大数) LL mult_mod(LL a,LL b,LL mod) //(a*... 阅读全文
摘要:
Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901) 阅读全文
摘要:
__int64 sum(__int64 p,__int64 n) //递归二分求 (1 + p + p^2 + p^3 +...+ p^n)%mod{ //奇数二分式 (1 + p + p^2 +...+ p^(n/2)) * (1 + p^(n/2+1)) if(n==0) //偶数二分式 (1 阅读全文