快速幂
西风丶
这个作者很懒,什么都没留下…
展开
-
HDU5666-Segment
HDU5666-Segment#include#includeusing namespace std;typedef long long ll;ll quickmul(ll a,ll b,ll p){ ll r=0; while(b) { if(b%2)//如果末位是1 { r+=原创 2016-04-24 11:02:15 · 298 阅读 · 0 评论 -
HDU5478 Can you find it (快速幂)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5478#include#includeusing namespace std;typedef long long ll;ll C;ll quickpow(ll a,ll b){ ll r=1,c=a; while(b) {原创 2016-07-19 16:27:59 · 350 阅读 · 0 评论 -
HDU1005(矩阵快速幂)
DescriptionA number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Inp原创 2016-09-03 13:29:26 · 385 阅读 · 0 评论