矩阵快速幂
oinei
欢迎加入菜鸡交流群:697208008
博主QQ:1119116025
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
nth Term (light oj)
You have to find the nth term of the following function:f(n) = a * f(n-1) + b * f(n-3) + c, if(n > 2)= 0, if(n ≤ 2)Input Input starts with an integer T (≤ 100), denoting the number of test cases.原创 2017-04-15 13:34:10 · 792 阅读 · 0 评论 -
矩阵快速幂模版
const ll mod=1000; const int N=4; struct node { ll a[N][N]; void init() { for(int i=0;i<N;i++) for(int j=0;j<N;j++) a[i][j]=0; for(int i=0...原创 2017-07-24 18:27:20 · 223 阅读 · 0 评论 -
51nod 矩阵快速幂模版题
51 nod给出一个N * N的矩阵,其中的元素均为正整数。求这个矩阵的M次方。由于M次方的计算结果太大,只需要输出每个元素Mod (10^9 + 7)的结果。 Input 第1行:2个数N和M,中间用空格分隔。N为矩阵的大小,M为M次方。(2 <= N <= 100, 1 <= M <= 10^9) 第2 - N + 1行:每行N个数,对应N * N矩阵中的1行。(0 <= N[i] <=原创 2017-05-11 19:35:04 · 267 阅读 · 0 评论
分享