
线性代数——线性递推关系
Alex_McAvoy
想要成为渔夫的猎手
展开
-
线性代数 —— 线性递推关系
【概述】线性递推关系是组合计数中一种常见的递推关系,关系式为:最著名的线性递推关系就是 Fibonacci 数列,有:f(1)=f(2)=1,f(n)=f(n-1)+f(n-2)对于线性递推关系,直接利用递推式,需要在 O(nd) 的时间内才能求出 F(n),时间无法承受,可以考虑借助矩阵来进行优化。现在已经有了:,那么再加上这种显然成立的式子,于是有:根据矩阵乘法的定...原创 2019-08-15 10:06:42 · 5059 阅读 · 0 评论 -
Reading comprehension(HDU-4990)
Problem DescriptionRead the program below carefully then answer the question.#pragma comment(linker, "/STACK:1024000000,1024000000")#include <cstdio>#include<iostream>#include...原创 2019-03-27 18:24:33 · 480 阅读 · 0 评论 -
233 Matrix(HDU-5051)
Problem DescriptionIn our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the question: Suppose we have a matri...原创 2019-03-27 13:51:16 · 255 阅读 · 0 评论 -
Jzzhu and Sequences(CF-450B)
Problem DescriptionJzzhu has invented a kind of sequences, they meet the following property:You are givenxandy, please calculatefnmodulo1000000007(109 + 7).InputThe first line contai...原创 2019-03-28 13:42:04 · 328 阅读 · 0 评论 -
Bear in the Field(CF-385E)
Problem DescriptionOur bear's forest has a checkered field. The checkered field is an n × n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from le...原创 2019-03-30 14:34:38 · 427 阅读 · 0 评论 -
M斐波那契数列(HDU-4549)
Problem DescriptionM斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = aF[1] = bF[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗?Input输入包含多组测试数据;每组数据占一行,包含3个整数a, b, n( 0 <= a, b, n <= ...原创 2019-03-28 22:39:10 · 669 阅读 · 0 评论