首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
BZOJ_3239_Discrete Logging_BSGS
】的更多相关文章
BZOJ_3239_Discrete Logging_BSGS
BZOJ_3239_Discrete Logging_BSGS 题意:Given a prime P, 2 <= P < 231, an integer B, 2 <= B < P, and an integer N, 2 <= N < P, compute the discrete logarithm of N, base B, modulo P. That is, find an integer L such that BL == N (mod P) 分析:BSGS…
[poj2417]Discrete Logging_BSGS
Discrete Logging poj-2417 题目大意:求$a^x\equiv b(mod\qquad c)$ 注释:O(分块可过) 想法:介绍一种算法BSGS(Baby-Step Giant-Step),网上大佬说拔山盖世qwq 算法是这样的(贼难受,所以手写了) 最后,附上丑陋的代码... ... #include <iostream> #include <cstdio> #include <cstring> #include <algorithm>…