FIBBIT - FIBO BIT
Count the number of numbers between two 64 bit numbers A, B that have the sum of their bits equal to a Fibonacci number. For example, between 15 and 17 there are two numbers that have sum of bits equal to a Fibonacci number.
15: 1111 sum=4
16: 10000 sum=1 (Fibonacci)
17: 10001 sum=2 (Fibonacci).
Input
The 2 numbers A and B.
A < B < 10^18.
Output
The number of such numbers between both A and B inclusive.
Example
Input: 15 17 Output: 2
hide comments
Mitch Schwartz:
2012-08-03 14:36:51
Why have you changed the limit from 10^18 to 2^18? I think this is a wrong decision. Please change it back to 10^18 and consider the changes I recommended, or else please move this to tutorial.
|
|
Mitch Schwartz:
2012-08-03 14:36:51
This is similar to some other problems in classical, but I think it may be different enough that people won't mind keeping it here.
|
|
Jared Deckard:
2012-08-03 14:36:51
start < end < 10^18 ?
|
Added by: | priyamehtanit |
Date: | 2012-08-02 |
Time limit: | 0.100s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |