文件名称:2060
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:471.45kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
判断另一种斐波那契系列是否是3 的倍数问题
该题如果用递归求出F(n),然后判
断将会超时。
注意到F(n) = F(n-1) + F(n-2)根据和的模等于模的和。
即有F(n)%3=(F(n-1)%3+F(n-2)%3)%3 F(0)%3=1,F(1)%3=2
计算F(n)%3 : 1,2,0,2,2,1,0,1,1,2,0,2,2,1……………
可以看出F(n)%3 以1,2,0,2,2,1,0,1, 重复出现
F(n)%3=0 即F(n)是3 的倍数此时的n 等于8k+2 或8k+6-Fibonacci Series 3 is whether the multiplier issue that if the calculated using recursive F (n), The judgment will then overtime. Notes F (n) = F (n-1) F (n-2) and the modulus and the same model. That is, F (n) = 3% (F (n-1)% F 3 (n-2)% 3)% 3 F (0%) 3 = 1, F (1)% 2 3 = calculated F (n)% 3 : 1,2,0,2,2,1,0,1,1,2,0. 2,2,1 ... ... ... can be seen F (n) 3% to 1,2,0,2,2,1,0,1, repeated F (n) = 0% 3 F (n) 3 is a multiple of n time to 8k or 8k 6 2
该题如果用递归求出F(n),然后判
断将会超时。
注意到F(n) = F(n-1) + F(n-2)根据和的模等于模的和。
即有F(n)%3=(F(n-1)%3+F(n-2)%3)%3 F(0)%3=1,F(1)%3=2
计算F(n)%3 : 1,2,0,2,2,1,0,1,1,2,0,2,2,1……………
可以看出F(n)%3 以1,2,0,2,2,1,0,1, 重复出现
F(n)%3=0 即F(n)是3 的倍数此时的n 等于8k+2 或8k+6-Fibonacci Series 3 is whether the multiplier issue that if the calculated using recursive F (n), The judgment will then overtime. Notes F (n) = F (n-1) F (n-2) and the modulus and the same model. That is, F (n) = 3% (F (n-1)% F 3 (n-2)% 3)% 3 F (0%) 3 = 1, F (1)% 2 3 = calculated F (n)% 3 : 1,2,0,2,2,1,0,1,1,2,0. 2,2,1 ... ... ... can be seen F (n) 3% to 1,2,0,2,2,1,0,1, repeated F (n) = 0% 3 F (n) 3 is a multiple of n time to 8k or 8k 6 2
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2060.cpp
2060.dsp
2060.dsw
2060.ncb
2060.opt
2060.plg
Debug/
Debug/1733.exe
Debug/1733.ilk
Debug/1733.obj
Debug/1733.pch
Debug/1733.pdb
Debug/2060.exe
Debug/2060.ilk
Debug/2060.obj
Debug/2060.pch
Debug/2060.pdb
Debug/vc60.idb
Debug/vc60.pdb
2060.dsp
2060.dsw
2060.ncb
2060.opt
2060.plg
Debug/
Debug/1733.exe
Debug/1733.ilk
Debug/1733.obj
Debug/1733.pch
Debug/1733.pdb
Debug/2060.exe
Debug/2060.ilk
Debug/2060.obj
Debug/2060.pch
Debug/2060.pdb
Debug/vc60.idb
Debug/vc60.pdb
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.