矩阵
文章平均质量分 86
liluoyu_1016
这个作者很懒,什么都没留下…
展开
-
Jzzhu and Sequences CodeForces - 450B 矩阵快速幂
Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). Input The first line contains two int原创 2017-10-29 09:00:22 · 223 阅读 · 0 评论 -
矩阵 快速幂
1. 快速幂 O(logn) #include #include using namespace std; typedef long long ll; ll mod_pow(ll x,ll n) { ll ret=1; while(n>0) { if(n&1) ret=ret*x; x=x*x; n>原创 2017-08-09 11:24:52 · 145 阅读 · 0 评论