快速幂
小天位
这个作者很懒,什么都没留下…
展开
-
poj 3150 Cellular Automaton(迷糊,但原理是用的快速幂)
http://blog.csdn.net/guard_mine/article/details/44351103http://www.cnblogs.com/xin-hua/archive/2013/07/29/3223984.htmlhttp://www.cnblogs.com/Blue233333/p/7445402.html原创 2017-10-24 16:56:38 · 337 阅读 · 0 评论 -
poj 3070 Fibonacci
FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11123 Accepted: 7913DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, th...原创 2017-10-24 15:42:19 · 240 阅读 · 0 评论 -
hdu 1575Tr A
Tr ATime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6348 Accepted Submission(s): 4707Problem DescriptionA为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(...原创 2018-04-07 14:19:10 · 146 阅读 · 0 评论 -
hdu A Simple Math Problem
Problem DescriptionLele 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<=i<=9) can ...原创 2018-04-07 19:47:06 · 203 阅读 · 0 评论 -
hdu 3117 Fibonacci Numbers
Problem DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f0 and f1 which are res...原创 2018-04-08 09:32:26 · 205 阅读 · 0 评论 -
hdu 2842 Chinese Rings
Problem DescriptionDumbear likes to play the Chinese Rings (Baguenaudier). It’s a game played with nine rings on a bar. The rules of this game are very simple: At first, the nine rings are all on the ...原创 2018-04-08 10:58:02 · 167 阅读 · 0 评论 -
hdu 1588 Gauss Fibonacci 较难
对于Fib序列:(如果用F表示上市中的矩阵就有 F(n+1) = AF(n) 是等比数列,g(i)=k*i+b 是等差数列)F(g(i)) = F(b) + F(b+k)+F(b+2k)+....+F(b+nk) = F(b) + (A^k)F(b) + (A^2k)F(b)+….+(A^nk)F(b)提取公因式 F(b) = F(b) [ E...原创 2018-04-08 18:55:12 · 187 阅读 · 0 评论