Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Tag : 「线性 DP」、「矩阵快速幂」

---

## 线性 DP
### 线性 DP

**定义 $f[i][j]$ 为考虑长度为 $i + 1$ 的字符串,且结尾元素为 $j$ 的方案数(其中 $j$ 代表数组 `['a', 'e', 'i', 'o', 'u']` 下标)。**

Expand Down Expand Up @@ -116,7 +116,8 @@ class Solution {
}
```
-
```Python3

```Python
MOD = int(1e9) + 7
class Solution:
def countVowelPermutation(self, n: int) -> int:
Expand All @@ -130,6 +131,7 @@ class Solution:
return (((((f[-1][0] + f[-1][1]) % MOD + f[-1][2]) % MOD + f[-1][3]) % MOD) + f[-1][4]) % MOD
```
-

```Go
const MOD int = 1e9 + 7
func countVowelPermutation(n int) int {
Expand Down Expand Up @@ -363,7 +365,7 @@ class Solution {
}
```
-
```Python3
```python
import numpy as np
MOD = 10 ** 9 + 7
dtype = np.dtype('uint64')
Expand Down