题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3231 矩阵乘法裸题. 1018是10^18.别忘了开long long. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define ll long long using namespace std; ; int n; ll L,R,b[N],c[N…
还好$QwQ$ 思路:矩阵快速幂 提交:1次 题解: 如图: 注意$n,m$如果小于$k$就不要快速幂了,直接算就行... #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #define ull unsigned long long #define ll long long #define R register ll using namespace std;…
矩阵乘法裸题..差分一下然后用矩阵乘法+快速幂就可以了. --------------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn = 20; typedef long long ll; t…