![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
矩阵快速幂
codingXT
菜鸡一枚,请多指教。
展开
-
poj 3233 Matrix Power Series
题目链接:点我 DescriptionGiven a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.InputThe input contains exactly one test case. The first line of input contains three p...原创 2018-08-22 11:11:20 · 1194 阅读 · 0 评论 -
poj Fibonacci 矩阵快速幂
题目链接:点我 DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, 1, 1, 2, 3, 5, 8, 13, 2...原创 2018-08-20 15:03:21 · 1314 阅读 · 0 评论 -
杭电 oj Array Challenge(矩阵快速幂+找规律)
题目链接:这里写链接内容 先求出式子的前几项 然后这个式子和h的式子是非常像的 得到递推式后就可以用矩阵快速幂了 详细看代码:#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>#inclu...原创 2018-08-20 17:53:50 · 1213 阅读 · 0 评论 -
杭电 1757 A Simple Math Problem (矩阵快速幂)
题目链接:点我Problem Description Lele now is thinking about a simple function f(x).If x < 10 f(x) = x. If x >= 10 f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + …… + a9 * f(x-10); And ai(0<...原创 2018-08-21 11:31:30 · 1267 阅读 · 0 评论 -
杭电 2157 How many ways??
题目链接:点我 Problem Description 春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问鼎广场看看喷泉, 再去教室, 也可以先到...原创 2018-08-21 14:26:08 · 1227 阅读 · 0 评论 -
杭电 2371 Decode the Strings
题目链接:点我 Problem Description Bruce Force has had an interesting idea how to encode strings. The following is the description of how the encoding is done: Let x1,x2,…,xn be the sequence of character...原创 2018-08-21 17:24:50 · 1244 阅读 · 0 评论