
快速幂
RDJ_Widow
这个作者很懒,什么都没留下…
展开
-
快速幂与矩阵快速幂
快速幂ll qpow(ll x,ll k){ ll res=1; x=x%mod; while (k)//把次数k看成二进制数 { if (k&1) res=res*x%mod;//遇到二进制位为1,就乘进答案里 x=x*x%mod;//加大权值 k>>=1; } retur...原创 2019-01-21 22:28:53 · 187 阅读 · 0 评论 -
Codeforces Round #533 (Div. 2) C. Ayoub and Lost Array
http://codeforces.com/contest/1105/problem/C数位DP#include<stdio.h>#include<stdlib.h>#include<math.h>#include<algorithm>#define ll long long#define pb push_back#define...原创 2019-01-21 22:36:15 · 272 阅读 · 0 评论 -
[HDU6470] Count(矩阵快速幂)
http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1010&cid=843#include<bits/stdc++.h>#define ll long long#define pb push_back#define INF 0x3f3f3f3f;#define fi first#define s...原创 2019-03-16 23:35:26 · 245 阅读 · 0 评论