matrix
I’ve been read Jane Eyre recently; I really love it.
矩阵快速幂
矩阵乘法满足结合律和分配律,不满足交换律
快速幂运算
如果数据太大,记得开 long long
1 | int power (int a, int n) { // a^n |
矩阵快速幂
应用:有以下递推式
构造矩阵
转换
得到新的递推式:
- Post title:matrix
- Post author:Eva.Q
- Create time:2022-03-22 14:08:01
- Post link:https://qyy/2022/03/22/Algorithm/matrix/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.