0
why do i get a "time limit exceeded" message whilst testing my code in the code playground?
5 Respuestas
+ 4
It means your code takes too long to execute. It may mean you have an infinite loop for example.
+ 4
The way it works is, your program is compiled and executed on a remote server, and sends back all the output at once once terminated or it reaches the time limit. Any input has to be given ahead of time.
If you made a mini-menu, I guess you put it in an infinite loop, and you were probably expecting more interactivity than sending everything before your program even asks.
0
yeah that usually happens with functions which call themselves like
def func(x)
if x==1:
return whatever
else:
return x*func(x-1)
If "x" is very big, even a computer it will give an error related to limited memory
0
so how can i avoid loads of memory in my code, i mean i only made a mini menu and the thing said time limit exceeded!
0
well, depending on the code you want to use, maybe you can or You cant optimize it