TOPIC
Time Limit - 1029
Gil101 asked 7 years ago
Estou recebendo time limit neste código, alguém tem alguma idéia?
def fib (n):
global count
count += 1
if n < 2: return n
else: return fib(n - 1) + fib(n -2)
q = int(input())
for i in range(q):
x = int(input())
count = 0
result = fib(x)
print("fib(%d) = %d calls = %d" %(x, (count - 1), result))