-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: 二項係数関連 | ||
documentation_of: //math/Binomial.hpp | ||
documentation_of: /math/Binomial.hpp | ||
--- | ||
|
||
## 説明 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: ボスタン森法 | ||
documentation_of: /fps/FPS_BostonMori.hpp | ||
--- | ||
|
||
## ボスタン森法 | ||
|
||
```cpp | ||
T Boston_Mori(long long k, std::vector<T> P, std::vector<T> Q) | ||
``` | ||
$[x^{k}](P(x) / Q(x))$ を返す関数 | ||
$N = \max(|P|, |Q|)$ として、 $O(N\log(N)\log(k))$ | ||
$Q(x)$ の DFT から $Q(-x)$ の DFT が簡単に求まることや、偶奇の取り出し、$0$ 詰めなどの高速化を行なっている。 | ||
## 線形漸化式 | ||
```cpp | ||
T Kth_Linear(long long k, std::vector<T> a, std::vector<T> c) | ||
``` | ||
|
||
$|a| = d, |c| = d + 1$ を満たす数列 $a, c$ を用いて、以下を満たす正整数列 $b$ の $k$ 項目を求める。 | ||
|
||
- $0\leq i< d\implies b_{i} = a_{i}$ | ||
- $k\leq i\implies 0 = \sum_{j = 0}^{d}b_{i - j}c_{j}$ | ||
|
||
計算量は $O(d\log(d)\log(k))$ |