快速幂
躺平平的弱鸡
IT界资深菜鸟。。
展开
-
NYOJp次方求和
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=420快速幂的模板题;代码:#include #define mod 10003int pow_mod(int a,int p,int m){ if(p == 0) return 1; int x = pow_mod(a原创 2016-04-08 11:58:12 · 540 阅读 · 0 评论 -
hdu1061Rightmost Digit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1061快速幂模板题#include const int mod = 1e5;typedef long long ll;ll quickAns(ll a,ll b){ ll res = 1; while(b) { if(b &原创 2016-04-22 23:50:49 · 243 阅读 · 0 评论 -
uva11582Colossal Fibonacci Numbers!(快速幂+预处理)
这个题不预处理要超时的。。代码:#include #include #include #include using namespace std;#define ll unsigned long longconst int maxn = 1e6;ll a,b;int n;vector f[1005];int c[1005];void init(){原创 2016-09-09 20:23:56 · 229 阅读 · 0 评论