数论
WibleL
这个作者很懒,什么都没留下…
展开
-
矩阵快速幂做斐波那契数列
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int mod = 10000; int n; struct mat{ long long a[5][5]; }; mat operator *(mat x,mat y) {原创 2020-07-07 19:37:50 · 142 阅读 · 0 评论 -
暑假训练数论板子
快速幂 int ksm(int a,int b) { int i=1,x=a; while(b!=0) { if(b&1) i*=x; x*=x; b>>=1; } return i; } 矩阵乘法 struct mat{ //定义矩阵结构体 long long a[maxn][maxn]; }; mat operator*(mat x,mat y){ //重载乘号(定义原创 2020-07-07 15:23:46 · 173 阅读 · 0 评论