描述 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 a ...
分类:
其他好文 时间:
2016-10-15 02:36:47
阅读次数:
129
UVA - 11987 Almost Union-Find I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not iden ...
分类:
其他好文 时间:
2016-10-13 03:05:11
阅读次数:
204
Fibonacci Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4805 Accepted Submission(s): 2223 Probl ...
分类:
其他好文 时间:
2016-10-10 23:51:19
阅读次数:
365
很久没写随笔了呀,因为看到记忆函数,确实搞懵逼了啊,实在是太菜了。 书本上给出的例子: 这样是可以工作的,但是它做了很多无谓的工作。 Fibonacci 函数被调用了 453 次。我们调用了 11 次,而它自身调用了 442 次去计算可能已经被刚计算过的值。如果我们让该函数具备记忆功能,就可以显著地 ...
分类:
其他好文 时间:
2016-10-10 02:05:27
阅读次数:
193
找Fn =( Fn-1 + Fn-2 ) mod n 的循环节 暴力找即可 ...
分类:
其他好文 时间:
2016-10-06 00:10:50
阅读次数:
144
A.As Easy As Possible B.Be Friends C.Coprime Heaven D.Drawing Hell E.Easiest Game F.Fibonacci of Fibonacci G.Global Warming H.Hash Collision I.Increas ...
分类:
其他好文 时间:
2016-10-05 21:50:09
阅读次数:
245
fibonacci数列(二) 时间限制:1000 ms | 内存限制:65535 KB 难度:3 fibonacci数列(二) 时间限制:1000 ms | 内存限制:65535 KB 难度:3 In the Fibonacci integer sequence, F0 = 0, F1 = 1, a ...
分类:
其他好文 时间:
2016-10-04 18:39:09
阅读次数:
213
【题目描述】 设f(n)为斐波那契数列第n项,其中f(0)=f(1)=1,f(n)=f(n?1)+f(n?2),求f(f(n))。 【输入描述】 第一行输入一个整数T,表示数据组数; 接下来T行每行输入一个整数n。 【输出描述】 输出n行,每行包含一个整数,表示答案对109+7取模的值。 【样例输入 ...
分类:
其他好文 时间:
2016-10-03 16:52:34
阅读次数:
135
Another kind of Fibonacci Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2353 Accepted Submissio ...
分类:
其他好文 时间:
2016-10-03 14:45:56
阅读次数:
148
题目描述 Description 定义:f0=f1=1, fn=fn-1+fn-2(n>=2)。{fi}称为Fibonacci数列。 输入n,求fn mod q。其中1<=q<=30000。 输入描述 Input Description 第一行一个数T(1<=T<=10000)。 以下T行,每行两个 ...
分类:
其他好文 时间:
2016-09-30 23:26:37
阅读次数:
183