动态规划——矩阵加速
文章平均质量分 76
JeremyGJY
然而并没有什么好说的
展开
-
【数论】【矩阵加速】[POJ3070]Fibonacci
题目描述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:1, 1, 2, 3, 5, 8, 13, 21, 34, …样例输入0 9 999999原创 2016-03-01 13:37:11 · 655 阅读 · 0 评论 -
【矩阵加速】【数论】【KMP】[BZOJ1009][HNOI2008]GT考试
题目描述Description阿申准备报名参加GT考试,准考证号为N位数X1X2….Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字。他的不吉利数学A1A2…Am(0<=Ai<=9)有M位,不出现是指X1X2…Xn中没有恰好一段等于A1A2…Am. A1和X1可以为0Input第一行输入N,M,K.接下来一行输入M位的数。 100%数据N<=10^9,M<=20,K<=1000 40%数原创 2016-03-02 14:06:01 · 1747 阅读 · 0 评论 -
【矩阵加速】[SPOJ SEQ]Recursive Sequence
题目描述Sequence (aia_i) of natural numbers is defined as follows:ai=bi(i≤k)a_i = b_i (i \leq k) ai=c1ai−1+c2ai−2+...+ckai−k(i>k)ai = c_1a_{i-1} + c_2a_{i-2} + ... + c_ka_i-k (i > k)where bjb_j and cjc原创 2016-03-04 12:53:40 · 788 阅读 · 0 评论 -
【矩阵加速】[POJ3233]Matrix Power Series
题目描述DescriptionGiven a n×nn\times n matrix A and a positive integer k, find the sum S=A+A2+A3+…+Ak.S = A + A^2 + A^3 + … + A^k.InputThe input contains exactly one test case. The first line of input con原创 2016-03-04 13:32:34 · 882 阅读 · 1 评论