文件名称:2060
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 471kb
- 下载次数:
- 0次
- 提 供 者:
- rcpo****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
判断另一种斐波那契系列是否是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
.....\1733.exe
.....\1733.ilk
.....\1733.obj
.....\1733.pch
.....\1733.pdb
.....\2060.exe
.....\2060.ilk
.....\2060.obj
.....\2060.pch
.....\2060.pdb
.....\vc60.idb
.....\vc60.pdb
2060.dsp
2060.dsw
2060.ncb
2060.opt
2060.plg
Debug
.....\1733.exe
.....\1733.ilk
.....\1733.obj
.....\1733.pch
.....\1733.pdb
.....\2060.exe
.....\2060.ilk
.....\2060.obj
.....\2060.pch
.....\2060.pdb
.....\vc60.idb
.....\vc60.pdb