2014年2月19日
摘要: 这里是题目地址题目意思很简单,就是已知n,k计算:其中是斐波那契数列第n-1项。n的范围是[1,1e17] ,k的范围是[1,40]看了一下觉得是快速幂,不过计算能力蒟蒻,纸上划了一天才得到结果 _(:з」∠)_定义:算一下:这样就有了线性迭代式,然后可以构造矩阵出来:然后用矩阵快速幂就可以搞定了。 1 #include 2 #include 3 #include 4 #define ll long long 5 using namespace std ; 6 int n ,c[50][50] ={1} ; 7 const int mod = 1e9+7 ; 8 struct MAT{... 阅读全文
posted @ 2014-02-19 19:58 MyWither 阅读(402) 评论(0) 推荐(0) 编辑