[luoguP1962] 斐波那契数列(矩阵快速幂)


传送门

解析详见julao博客连接worldframe.top/2017/05/10/清单数学方法——矩阵/

——代码

1 #include <cstdio> 2 #include <cstring> 3 #define LL long long 4 5 LL n; 6 const int p = 1e9 + 7; 7 8 struct Matrix 9 15 }; 16 17 inline Matrix operator * (const Matrix x, const Matrix y) 18 27 28 inline int pow(LL x) 29 39 return ans.a[0][0]; 40 } 41 42 int main() 43
View Code



上一篇:[1143] [CTSC2008]祭祀river(最大独立集 || 偏序集最大反链)

下一篇:[luoguP2885] [USACO07NOV]电话线Telephone Wire(DP + 贪心)


DP 矩阵
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图