摘要:
我们令 Ψ(x) 定义为欧拉函数。 欧拉定理描述 : 若 (a , p) = 1 , 那么 aΨ(p) Ξ 1 (mod p) . 证明: 先预热一下: Ⅰ.我们令 x1 , x2 , x3 , ……, xs 为 模p 的简化剩余系 (若果对任意的1 ≤ j ≤ s , (xj , p) = 1 并 阅读全文
摘要:
求[(5+2√6)2^x+1 ] mod p 的值,其中 0 ≤ x < 232 , p 是个质数,p≤ 46337 .(这里介绍的是一种暴力的做法)(5+2√6)2^n+1 = an + bn·√6 ----©,(5-2√6)2^n+1 = an - bn·√6 ;所以(5+2√6)2^n+1 +... 阅读全文
摘要:
#includeusing namespace std;int mod ;struct Matrix { int n , m ; int mat[4][4] ; int * operator [] (int x) { return... 阅读全文
摘要:
最近碰到一题,问你求mod (p1*p2*p3*……*pl) ,其中n和m数据范围是1~1e18 , l≤10 , pi ≤ 1e5为不同的质数,并保证M=p1*p2*p3*……*pl≤ 1e18 。要解决这个问题首先需要Lucas定理或者C!解法。Lucas定理:我们令n=sp+q , m=tp+... 阅读全文
摘要:
Elven PostmanTime Limit: 1500/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 147Accepted Submission(s): 90Proble... 阅读全文
摘要:
B. Modulo Sumtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence of numbers... 阅读全文
摘要:
H. Botstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSasha and Ira are two best friends. But... 阅读全文
摘要:
#include #include #include #include #include #include using namespace std; const int numlen = 205; // 位数 int max(int a, int b) { return a>b?a:b; }stru... 阅读全文
摘要:
ReflectTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 288Accepted Submission(s): 174Problem Descr... 阅读全文
摘要:
//POJ 1811#include #include #include #include #include using namespace std;typedef __int64 lld;lld ran() { return rand() = mod) x -= mod;}lld mul_m... 阅读全文