Skip to content

Commit

Permalink
Deployed 8bb7852 with MkDocs version: 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dianhsu committed Mar 18, 2023
1 parent d850a95 commit e44101e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion css/extra.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
code {
font-size: 13px !important;
font-family: Consolas, 'Courier New', Courier, monospace;
font-size: 14px !important;
}
34 changes: 17 additions & 17 deletions math/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@
</li>

<li class="md-nav__item">
<a href="#阶乘逆元求组合数" class="md-nav__link">
阶乘逆元(求组合数)
<a href="#组合数" class="md-nav__link">
组合数
</a>

</li>
Expand Down Expand Up @@ -926,8 +926,8 @@
</li>

<li class="md-nav__item">
<a href="#阶乘逆元求组合数" class="md-nav__link">
阶乘逆元(求组合数)
<a href="#组合数" class="md-nav__link">
组合数
</a>

</li>
Expand Down Expand Up @@ -1087,9 +1087,7 @@
<h1>首页</h1>

<h2 id="模数int">模数(int)<a class="headerlink" href="#模数int" title="Permanent link">&para;</a></h2>
<pre><code class="language-cpp">#include &lt;bits/stdc++.h&gt;

template&lt;int P&gt;
<pre><code class="language-cpp">template&lt;int P&gt;
class MI{
public:
static int selfPow(int base, int p){
Expand Down Expand Up @@ -1270,9 +1268,11 @@ <h3 id="奇数筛">奇数筛<a class="headerlink" href="#奇数筛" title="Perma
</code></pre>
<h2 id="类欧几里得算法">类欧几里得算法<a class="headerlink" href="#类欧几里得算法" title="Permanent link">&para;</a></h2>
<div class="arithmatex">\[
f(N, a, b, c) = \sum_{i = 0}^N \lfloor \frac{a \times i + b}{c} \rfloor \\
\begin{matrix}
f(N, a, b, c) = \sum_{i = 0}^N \lfloor \frac{a \times i + b}{c} \rfloor \\
g(N, a, b, c) = \sum_{i = 0}^N \lfloor \frac{a \times i + b}{c} \rfloor ^2 \\
h(N, a, b, c) = \sum_{i = 0}^N i \times \lfloor \frac{a \times i + b}{c} \rfloor
\end{matrix}
\]</div>
<pre><code class="language-cpp">##include &lt;iostream&gt;
##include &lt;algorithm&gt;
Expand Down Expand Up @@ -1500,27 +1500,27 @@ <h3 id="批量乘法逆元">批量乘法逆元<a class="headerlink" href="#批
return inv;
}
</code></pre>
<h2 id="阶乘逆元求组合数">阶乘逆元(求组合数)<a class="headerlink" href="#阶乘逆元求组合数" title="Permanent link">&para;</a></h2>
<pre><code class="language-cpp">template&lt;typename T = long long, int P = 1000000007&gt;
class Combination{
<h2 id="组合数">组合数<a class="headerlink" href="#组合数" title="Permanent link">&para;</a></h2>
<pre><code class="language-cpp">template&lt;typename T = int, int P = 1000000007&gt;
class Comb{
public:
Combination(int n): div(n + 1, 1), mul(n + 1, 1){
for(int i = 1; i &lt;= n; ++i) mul[i] = mul[i - 1] * i % P;
Comb(int n): div(n + 1, 1), mul(n + 1, 1){
for(int i = 1; i &lt;= n; ++i) mul[i] = 1ll * mul[i - 1] * i % P;
div[n] = qPow(mul[n], P - 2);
for(int i = n - 1; i &gt; 0; --i) div[i] = div[i + 1] * (i + 1) % P;
for(int i = n - 1; i &gt; 0; --i) div[i] = 1ll * div[i + 1] * (i + 1) % P;
}
T operator () (int n, int m){
if(m &lt; 0) return 0;
if(m &gt; n) return 0;
return mul[n] * div[m] % P * div[n - m] % P;
return 1ll * mul[n] * div[m] % P * div[n - m] % P;
}

private:
T qPow(T b, T n){
T ret = 1;
while(n){
if(n &amp; 1) ret = ret * b % P;
b = b * b % P;
if(n &amp; 1) ret = 1ll * ret * b % P;
b = 1ll * b * b % P;
n &gt;&gt;= 1;
}
return ret;
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit e44101e

Please sign in to comment.