
矩阵快速幂
coldfresh
那我们开始吧
展开
-
Blocks (POJ - 3734)(矩阵快速幂)
Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a line and each bl原创 2017-04-29 14:32:06 · 1094 阅读 · 0 评论 -
Fibonacci (POJ - 3070 )(矩阵快速幂)
In 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, 21, 34, …An alternative fo原创 2017-04-29 14:42:07 · 426 阅读 · 0 评论 -
Different Circle Permutation HDU - 5868(burnside引理+递推+矩阵快速幂+欧拉函数)
You may not know this but it’s a fact that Xinghai Square is Asia’s largest city square. It is located in Dalian and, of course, a landmark of the city. It’s an ideal place for outing any time of the y原创 2017-09-07 13:58:35 · 458 阅读 · 0 评论 -
有点复杂的数列
题目描述 acndy喜欢做数学题,学了数论以后更是一发不可收拾,他发现一个数列:给出n,a,b,c的值,他想算出fn模p后的值。输入 第一行一个数T,为测试数据组数, 每组数据一行,一行五个正整数,按顺序为n,a,b,c,p, 1<=T<=10,1<=n<=1e18,1<=a,b,c<=1e9,p是质数且p<=1e9+7。 输出 对...原创 2018-02-21 00:35:51 · 630 阅读 · 0 评论 -
【2018 Multi-University Training Contest 7】Sequence(分块+矩阵快速幂)
Problem Description Let us define a sequence as below⎧⎩⎨⎪⎪⎪⎪⎪⎪F1F2Fn===ABC⋅Fn−2+D⋅Fn−1+⌊Pn⌋Your job is simple, for each task, you should output Fn module 109+7.Input The first line has only on...原创 2018-08-13 21:56:27 · 261 阅读 · 0 评论