2016年9月18日

HDU 5895 矩阵快速幂+高次幂取模

摘要: HDU 5895 Mathematician QSC 题意:已知f(n)=2*f(n-1)+f(n-2), g(n)=∑f(i)²(0<=i<=n), 给出n,x,y,s, 求x^(g(n*y))%(s+1); 思路:OEIS查到了g(n)=f(n)*f(n+1)/2, f(n)可以用矩阵快速幂求得 阅读全文

posted @ 2016-09-18 23:16 Psong 阅读(809) 评论(0) 推荐(0) 编辑

导航