骗小孩的数论
exgcd
和
考虑求出
若已知
将
整理得
我们不妨令
就结束了。
然而对于一般的不定方程
那么原方程的一组解就是
excrt
据说这个比 crt 好理解来着。
excrt 更像是 trick,而非比较牛的算法。
考察同余方程组
我们希望他们被合并成一个。
考虑把他们打开得到
所以有
考虑用 exgcd 解出
设
则
对
结束。
- Title: 骗小孩的数论
- Author: rainbow-auto
- Created at : 2025-07-28 20:41:53
- Updated at : 2025-07-28 20:57:03
- Link: https://rainbow-auto.github.io/2025/07/28/骗小孩的数论/
- License: This work is licensed under CC BY-NC-SA 4.0.
Comments