b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
NeverLearn (root 4 Montoya) 于 (Sun Sep 18 02:38:06 2005) 提到:
发信人: NeverLearn (root 4 Montoya), 信区: CS
标 题: How to detect if a number is a fibonacci number?
发信站: BBS 未名空间站 (Sun Sep 18 02:37:46 2005), 转信
rt, given a number, how to quickly detect that? Heard there's a
fast way to do that. Any one knows?
☆─────────────────────────────────────☆
Qing (阿卿) 于 (Sun Sep 18 04:16:12 2005) 提到:
fibonacci数增长暴快,所以一个一个的算就很快了啊。O(logn)。
32位整数,算最多48次就搞定了。64位整数也只要9 |
|