随笔分类 -  矩阵快速幂

摘要:给出一个N * N的矩阵,其中的元素均为正整数。求这个矩阵的M次方。由于M次方的计算结果太大,只需要输出每个元素Mod (10^9 + 7)的结果。#include#include#include#includeusing namespace std;const in... 阅读全文
posted @ 2016-03-05 18:49 __NaCl 阅读(165) 评论(0) 推荐(0)
摘要:第1行:1个数N,表示矩阵的大小(2 #include#include#includeusing namespace std;const int N=100;struct Mat{ int a[N][N];};int n;Mat mitriplus(Mat A,Mat... 阅读全文
posted @ 2016-03-05 18:47 __NaCl 阅读(172) 评论(0) 推荐(0)