complete 6571.py
This commit is contained in:
28
zeta_python/completed/6571.py
Normal file
28
zeta_python/completed/6571.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import sys
|
||||||
|
import bisect
|
||||||
|
|
||||||
|
input = sys.stdin.readline
|
||||||
|
|
||||||
|
Mem = [1, 2, 3]
|
||||||
|
|
||||||
|
|
||||||
|
def fib_count(a: int, b: int):
|
||||||
|
if b <= Mem[-1]:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
while b > Mem[-1]:
|
||||||
|
Mem.append(Mem[-1] + Mem[-2])
|
||||||
|
|
||||||
|
right = bisect.bisect_right(Mem, b)
|
||||||
|
left = bisect.bisect_left(Mem, a)
|
||||||
|
|
||||||
|
return right - left
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
while True:
|
||||||
|
a, b = map(int, input().split())
|
||||||
|
if a == b == 0:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
print(fib_count(a, b))
|
||||||
Reference in New Issue
Block a user