随笔分类 - 线性代数
摘要:题意:给一张有向简单图,给出邻接矩阵,求长度为 \(K\) 的路径条数,答案对 \(10^9+7\) 取模。 题解: 代码: #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <bi
阅读全文
摘要:原题链接 题意:\(A_i = A_{i-1}\times A_x + A_y,B_i = B_{i-1}\times B_x + B_y\),给出$A_0,B_0,A_x,B_x,A_y,B_y$求,\(\sum ^{n-1}_{i = 0}A_i\times B_i\),$0<=n<=1e18$
阅读全文
摘要:原题链接 题意:多组输入,输入 \(1 <= n ,m <=1000000000\),\(ans=0\) ,当 \(ans\) 为偶数, \(ans = ans\times 2 + 1\),如果 \(ans\) 为奇数,那么 \(ans = ans\times 2\)。输出 \(ans\)。 题解:
阅读全文
摘要:原题链接 题意:给出矩阵 \(A\),为 \(N\times M\) 的矩阵,矩阵 \(B\) 为 \(M \times N\) 的矩阵,\(4 <= N <= 1000, 1 <= M <= 10\) ,设矩阵 \(C = A \times B\) 求出 \(C^n\) 各个元素和。 题解:可以发
阅读全文