Recursionerror: Maximum Recursion Depth Exceeded - How to overcome?
📁 python, pergunta, conselho, IA
Há uma tarefa; há uma solução onde, graças ao Python, "derrotou" o C#, mas o recursionerror aparece em x = 512: O que vocês aconselham, colegas? Como superar, se quiser calcular para x = 1024, por exemplo?
import functools
from math import sqrt
@functools.lru_cache()
def f(x):
if x <= 1:
return 0
return 1 + min([f(x // m - ...