Lang:G++
Edit12345678910111213141516171819202122232425262728293031//#define DEBUG//#define PROBLEM//#define MY#include <bits/stdc++.h>#define mt(a, b) memset(a, b, sizeof(a))using namespace std;typedef long long LL;const double PI = acos(-1.0);const double EPS = 1e-8;const LL MOD = 1e9 + 7;const int M = 1e2 + 10;class Matrix { ///矩阵typedef LL typev;///权值类型static const int MV=10;///矩阵长度static const LL mod=MOD;///%modfriend Matrix operator *(const Matrix &a,const Matrix &b) { ///矩阵乘法,必须a的列等于b的行Matrix ret;ret.n=a.n;ret.m=b.m;ret.zero();if(a.m==b.n) {for(int k=0; k<a.m; k++) {for(int i=0; i<a.n; i++) {if(a.val[i][k]) {for(int j=0; j<b.m; j++) {ret.val[i][j]+=a.val[i][k]*b.val[k][j];ret.val[i][j]%=mod;///看具体需要}}}}