矩阵快速幂
crazy morning
去西之西处,驾驭长风
展开
-
P3758 [TJOI2017]可乐
题目 题目 思路 把道路抽象成邻接矩阵跑快速幂。 code: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; long long n,myd=2017,m; const int lim=101; struct Matrix{ long long m[lim+1][lim+1原创 2021-05-22 08:24:37 · 63 阅读 · 1 评论 -
P1962 斐波那契数列
题目 题目 思路 矩阵快速幂模板题 code: #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; long long n,myd=1e9+7; const int lim=2; struct Matrix{ int m[lim+1][lim+1]; }; Matrix cf(原创 2021-05-14 19:40:06 · 48 阅读 · 0 评论