How Many Fibs?
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6345 Accepted Submission(s): 2506
Problem Description
Recall the definition of the Fibonacci numbers:
Given two numbers a and b, calculate how many Fibonacci numbers are in the range [a, b].
Input
The input contains several test cases. Each test case consists of two non-negative integer numbers a and b. Input is terminated by a = b = 0. Otherwise, a <= b <= 10^100. The numbers a and b are given with no superfluous leading zeros.
Output
For each test case output on a single line the number of Fibonacci numbers fi with a <= fi <= b.
Sample Input
Sample Output
Source
University of Ulm Local Contest 2000
Recommend
Eddy | We have carefully selected several similar problems for you: 1753 1063 1047 1250 1147
Statistic | Submit | Discuss | Note
做了上个大数 没想到两道题的斐波那契数列初始化一个f[2]=1,一个f[2]=2不一样。。坑