Gauss Fibonacci(矩阵快速幂+二分求矩阵和)

Without expecting, Angel replied quickly.She says: "I’v heard that you’r a very clever boy. So if you wanna me be your GF, you should solve the problem called GF~. "How good an opportunity that Gardon can not give up! The "Problem GF" told by Angel is actually "Gauss Fibonacci".As we know ,Gauss is the famous mathematician who worked out the sum from 1 to 100 very quickly, and Fibonacci is the crazy man who invented some numbers.Arithmetic progression:g(i)=k*i+b;We assume k and b are both non-nagetive integers.Fibonacci Numbers:f(0)=0f(1)=1f(n)=f(n-1)+f(n-2) (n>=2)The Gauss Fibonacci problem is described as follows:Given k,b,n ,calculate the sum of every f(g(i)) for 0<=i<nThe answer may be very large, so you should divide this answer by M and just output the remainder instead.

,学会宽容,要有一颗宽容的爱心!

Gauss Fibonacci(矩阵快速幂+二分求矩阵和)

相关文章:

你感兴趣的文章:

标签云: