We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 735542b commit 820fb41Copy full SHA for 820fb41
math/数论算法模板总结.md
@@ -137,6 +137,19 @@ LL big_mod(string val,LL mod)
137
return res;
138
}
139
```
140
+##模方程
141
+```c++
142
+LL MLE(LL a,LL b,LL n){
143
+ LL d,x,y;
144
+ d = ex_gcd(a,n,x,y);
145
+ if(b%d !=0){
146
+ return -1;
147
+ }else{
148
+ LL x0 = x*b/d%n+n;
149
+ return x0%(n/d);//模(n/d)
150
+ }
151
+}
152
+```
153
##乘法逆元
154
a在模n意义下的逆
155
```c++
0 commit comments