摘要:        
这题很容易就可以推出f(n)的公式。这个用到了矩阵和整数的快速2分幂,还需注意一点就是pow(n,m)=pow(n,m mod 1000000006);千万注意别写成mod 1000000007 ,否者会一直WA的。#include<iostream>#include<stdio.h>using namespace std;typedef __int64 in;struct aa{ in a[2][2]; void init() { a[0][0]=a[0][1]=a[1][0]=1; a[1][1]=0; }};aa mul(aa m,aa n){ aa ans; f    阅读全文
posted @ 2013-05-20 14:24
_随心所欲_
阅读(266)
评论(0)
推荐(0)
        

浙公网安备 33010602011771号