矩阵快速幂
黑码
这个作者很懒,什么都没留下…
展开
-
codeforces 185A 矩阵快速幂
Dwarfs have planted a very interesting plant, which is a triangle directed “upwards”. This plant has an amusing feature. After one year a triangle plant directed “upwards” divides into four triangle pl原创 2017-03-21 15:55:14 · 430 阅读 · 0 评论 -
矩阵快速幂优化递推式 例:斐波那契数列 poj 3070
转载http://blog.csdn.net/g_congratulation/article/details/52734306 注意边界就好 习惯的模板就是直接来原创 2017-03-21 16:26:36 · 399 阅读 · 0 评论 -
qwb与神奇的序列 快速幂 非逆元 矩阵快速幂
转我自己的博客:写得贼好 http://blog.csdn.net/yo_bc/article/details/72846995Description qwb又遇到了一道题目: 有一个序列,初始时只有两个数x和y,之后每次操作时,在原序列的任意两个相邻数之间插入这两个数的和,得到新序列。举例说明: 初始:1 2 操作1次:1 3 2 操作2次:1 4 3 5 2 …… 请问在操作n次之转载 2017-06-05 01:08:43 · 366 阅读 · 0 评论 -
矩阵快速幂比较好的写法
#include #include #include #include #include typedef long long int lli; using namespace std; #define N 3 const lli mod = 1e9+7;//注意这里要是没有const会慢3~4倍。 struct mat{ lli mat[N][N]; }; mat operat原创 2017-08-29 14:48:35 · 475 阅读 · 0 评论