Skip to content

Commit 764b15d

Browse files
committed
修改数论模板排版
1 parent 7eefa9b commit 764b15d

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

math/数论算法模板总结.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

2-
#公约数
3-
##gcd
2+
# 公约数
3+
## gcd
44

55
```c++
66
LL gcd(LL a,LL b)
77
{
88
return b==0? a:gcd(b,a%b);
99
}
1010
```
11-
##ex_gcd
11+
## ex_gcd
1212
1313
```c++
1414
//返回值为最大公约数
@@ -23,10 +23,11 @@ LL ex_gcd(LL a,LL b,LL &x,LL &y)
2323
return d;
2424
}
2525
```
26-
#素数
26+
# 素数
2727

28-
##素因子分解
28+
## 素因子分解
2929
$朴素算法O(\sqrt n)$
30+
3031
```c++
3132
void prime_factor(int n,map<int,int> &pf)//
3233
{
@@ -41,7 +42,7 @@ void prime_factor(int n,map<int,int> &pf)//
4142
if(n!=1)pf[n] = 1;
4243
}
4344
```
44-
##Eratosthenes筛法
45+
## Eratosthenes筛法
4546
4647
```c++
4748
void Eratosthenes(int n)
@@ -53,7 +54,7 @@ void Eratosthenes(int n)
5354
for(int j=i*i ; j<=n ; j+=i)is_prime[j] = false;
5455
}
5556
```
56-
##区间筛法
57+
## 区间筛法
5758

5859
```c++
5960
void segment_sieve(LL a,LL b)//[a,b]
@@ -181,8 +182,8 @@ void phi_table(int n)
181182
}
182183
```
183184

184-
#模运算
185-
##power_mod
185+
# 模运算
186+
## power_mod
186187

187188
```c++
188189
LL power_mod(LL x,LL n,LL mod)
@@ -198,7 +199,7 @@ LL power_mod(LL x,LL n,LL mod)
198199
}
199200

200201
```
201-
##大数乘法取模
202+
## 大数乘法取模
202203
203204
```c++
204205
LL mulmod(LL a,LL b,LL mod){
@@ -226,7 +227,7 @@ LL big_mod(string val,LL mod)
226227
return res;
227228
}
228229
```
229-
##模方程
230+
## 模方程
230231
```c++
231232
LL MLE(LL a,LL b,LL n){
232233
LL d,x,y;

0 commit comments

Comments
 (0)