0
How much time do you have to run your program?
I think you have 5 seconds to run it all otherwise it will say "Time limit exceeded" but while I was trying I found something interesting. https://code.sololearn.com/cOz9ObfUQmQX/?ref=app It's very easy. Python code import time time.sleep(4.95) print("Hello world") I used 4.95 because also importing and printing take some times. The output is: Hello World Time limit exceeded How is that possible? Edit: I tried to do it again and it didn't worked. So I start changing the time and I got it again at 4.815 maybe it's just a matter of connection?
6 Answers
+ 2
its a sololearn thing
its not a live interpreter. it processes it on server and outputs the output.
if the process takes over 5secs it times out
+ 1
This time only for sololearn playground if you run your code on computer with offline ide then you can sleep your code 1 hour or according to your need.
0
Yes but how did I got both the output and time limit exceeded in the same run?
0
sometimes you do. probably returns possible generated values if they are stored for the return even if the limit exceeds
0
But usually no output is printed if the limit exceeded
0
Yeah of course you have 5 sec only because otherwise you could do a denial of services attack