摘要: #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*... 阅读全文
posted @ 2017-11-19 21:24 会飞的雅蠛蝶 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 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) 阅读全文
posted @ 2017-11-19 18:46 会飞的雅蠛蝶 阅读(93) 评论(0) 推荐(0) 编辑
摘要: __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 阅读全文
posted @ 2017-11-19 18:42 会飞的雅蠛蝶 阅读(231) 评论(0) 推荐(0) 编辑