![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
乘法逆元
Hacheylight
ZJ OIer
展开
-
沙拉公主的困惑 (乘法逆元+素数判定)
加了各种优化,BZOJ还是没过,洛谷倒是过了主要预处理不是O(n),所以挂了。乘法逆元+素数#pragma GCC diagnostic error "-std=c++11"#pragma GCC optimize("-fdelete-null-pointer-checks,inline-functions-called-once,-funsafe-loop-optimizatio...原创 2018-07-26 20:18:47 · 223 阅读 · 0 评论 -
【模板】乘法逆元
逆元有4种求法:费马小定理exgcd递推式(本方法)快速幂// luogu-judger-enable-o2#include <bits/stdc++.h>using namespace std ;typedef long long ll ;const int N = 3000010 ;ll n,p ;ll a[N] ;int main(){ ...原创 2018-07-26 21:07:30 · 632 阅读 · 0 评论 -
数论模板总结
数论模板总结错误什么的都请大佬就出来,博主会飞速改!!!快速乘int fastmul(int a, int b, int p) { int x = 0 ; while (b) { if (b &amp;amp;amp;amp; 1) x = (x + a) % p ; a = (a + a) % p ; b &amp;amp;amp;gt;&amp;amp;amp;gt;= 1 ; } return x ;}原创 2018-10-29 21:18:19 · 199 阅读 · 4 评论 -
数论初步总结
前面的简单小知识到时候再补充先写类欧原创 2019-01-27 09:33:32 · 376 阅读 · 2 评论