分享矩阵快速幂的做法,时间复杂度可以降低至O(logn)
#include<bits/stdc++.h>
using namespace std;
struct mat{
int n1,n2,n3,n4;
};
mat muti(mat m1,mat m2){
int n1 = m1.n1*m2.n1 + m1.n2*m2.n3;
int n2 = m1.n1*m2.n2 + m1.n2*m2.n4;
int n3 = m1.n3*m2.n1 + m1.n4*m2.n3;
int n4 = m1.n3*m2.n2 + m1.n4*...