#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 7; struct matrix { int a[5][5]={}; int n,m; }; matrix I(int n) { matrix ret; ret.n=n; ret.m=n; for(int i=1;i<=n;i++) ret.a[i][i]=1; return ret; } matrix operator…
#include <iostream> #include <algorithm> #include <cmath> #define MOD 7 #define N 2 using namespace std; struct Matrix { long long v[N][N]; }; //矩阵间的乘法%m Matrix matrix_mul(Matrix A, Matrix B, long long m) { Matrix ans; ; i < N; i++) {…