发现,看式子是个递推,所以是矩阵乘法。和 class Solution { public: typedef long long ll ll mod=1e9+7; struct nkl{ ll d[3][3]; }; inline ll Get(ll n,ll x,ll y,ll xx,ll yy,ll zz){ if(n==1) return x; if(n==2) return y; n-=2; nkl a; memset(a.d,0,sizeof(a.d...