+ 1
Time limit exceeded!!!
When I try to run my code it is always saying "Time limit exceeded"! Who can explain this problem? What should I do?
4 Answers
+ 4
Do you have loops in your code? If so, one or more of them may be an infinite loop. Ex:
i = 1
while i<5:
i--
print(i)
Otherwise, your code may be exceedingly long, perhaps if it contains over 300 lines. Try to put multiple lines on one line, or use shorter statements.
+ 6
If you are trying to run your code in this App's compiler then sometimes if your code contain large calculations it may show "time limit exceeded!".
you can't help it, it's this application's fault.
but you can try other compilers which can run your code even if it contain large calculations. one of them is the qpython3 app from android market. use it to run your codes.
+ 2
It probably means that you have an infinite loop somewhere in your code. Check your loops and make sure they can terminate.
0
Is it impossible to run infinity loop?