算法競賽——進階指南——acwing205. 斐波那契 矩陣快速冪

利用了矩陣結合律,先算出構造遞推矩陣自乘的結果,再與初始矩陣相乘。ios #include <bits/stdc++.h> using namespace std; typedef long long ll; #define ls (o<<1) #define rs (o<<1|1) #define pb push_back //#define a(i,j) a[(i)*(m+2)+(j)] /
相關文章
相關標籤/搜索