![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
矩阵快速幂
小菜鸡在努力啊
余生很长,请多指教。
展开
-
矩阵快速幂(模板)
矩阵快速幂模板 传送门 #include <bits/stdc++.h> using namespace std; long long n; struct mat { long long g[110][110]; void clear() { memset (g, 0, sizeof (g));//清0 return ; } mat operator * (const mat& b) { mat tmp;//tmp要作为返回值 tmp.clear()原创 2020-06-05 21:29:47 · 139 阅读 · 0 评论 -
矩阵快速幂(模板)
poj3070 快速幂模板: while(b){ if(b&1){ ans=ans*a%p; } a=a*a%p; b>>=1; } Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 25547 Accepted: 17065 Desc...原创 2020-04-10 11:08:12 · 118 阅读 · 0 评论