题目大意:就是给出a,b,n,m:让你求s(n); 解题思路:因为n很可能很大,所以一步一步的乘肯定会超时,我建议看代码之前,先看一下快速幂和矩阵快速幂,这样看起来就比较容易,这里我直接贴别人的推导,应该很容易懂. 看到这里你应该明白了大概吧!好吧现在继续看我的代码吧!! AC代码: #include<stdio.h> long long c[2][2],d[2]; int main() { long long a,b,n,m,x,y,p,q; while(scanf("%I64d%…
Sequence Accepts: 59 Submissions: 650 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description \ \ \ \ Holion August will eat every thing he has found. \ \ \ \ Now there are many foods,but he does…
Recursive sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 249 Accepted Submission(s): 140 Problem Description Farmer John likes to play mathematics games with his N cows. Recently, t…