随笔分类 -  数学 - BSGS

摘要:模板题呀. code: #include <cstdio> #include <cstring> #include <cmath> #include <map> #include <algorithm> #define ll long long #define setIO(s) freopen(s" 阅读全文
posted @ 2020-02-04 10:12 EM-LGH 阅读(123) 评论(0) 推荐(0)
摘要:这里讲一下普通的 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 阅读全文
posted @ 2020-02-04 09:47 EM-LGH 阅读(168) 评论(0) 推荐(0)