随笔分类 - 数学 - BSGS
摘要:模板题呀. code: #include <cstdio> #include <cstring> #include <cmath> #include <map> #include <algorithm> #define ll long long #define setIO(s) freopen(s"
阅读全文
摘要:这里讲一下普通的 BSGS 如何实现: 我们要求解形如 $y^x \equiv z(\mod p)$ 的 $x$ 的整数解(其中 $gcd(y,p)=1$) 我们将 $x$ 写成 $am-b$ 的形式,原式就变为 $y^{am} \equiv z \times y^b (\mod p)$ 然后 $b
阅读全文

浙公网安备 33010602011771号