10518专题

UVA 10518 How Many Calls?

题意:涉及到矩阵的快速幂取模,这里有一篇关于快速幂取模的文章点击打开链接,题目要求的是求函数F(n)计算的次数,然后输出f(n) MOD m的结果,很容易知道f(n)=f(n-1)+f(n-2)+1, 然后又看了这篇分析 点击打开链接 #include <iostream>#include <cstdio>#include <cstring>#include <algorithm>