Skip to content

Commit

Permalink
ボスタン森 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
potato167 committed Jun 19, 2024
1 parent 6862791 commit 386f54d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/math/Binomial.md
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
---

## 説明
Expand Down
29 changes: 29 additions & 0 deletions docs/math/FPS_Boston_Mori.md
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))$

0 comments on commit 386f54d

Please sign in to comment.