+ 7

what does it mean by "Time limit exceeded" in solo learn editor?

27th Sep 2017, 10:41 PM
Zohaib šŸ‘‘
Zohaib šŸ‘‘ - avatar
11 Answers
+ 12
Sorry been busy with work and responsibilities that my down time is used up... Still in effort to see what are we dealing with when we compile and run a program in relation to timeouts, I was able to slowly come up with some small tools but limited by necessary SL security blocks. From all these tools it seems you are logged in as user named ā€œcompilerā€ and there is a Compiler process that is common in all runs. Not sure yet if that process is kicked off only for C# code or not. Reason for saying that is I saw a g++ (GNU C++) process and not sure if the SL server I was using whether virtual or not was compiling someone elseā€™s C++ code at the time. Only saw it once. Will pick this up later. https://code.sololearn.com/c05eWtYfsWBo/#cs - to see running processes when this code is run. https://code.sololearn.com/cweQ2MVZN7ug#py - Python SL env version
27th Jan 2018, 3:11 PM
cyber33
cyber33 - avatar
+ 11
Hi dimon2101, that code is neither brutal or dumb design... One could do time calculations which I have seen some SoloLearners submitted to time sections or most of their code. But your code is excellent for our investigation. Also your code is sending me on another journey which Iā€™m enjoying and thank you for that! I have investigated some code to examine system properties in search of what we are running on which could most likely be a virtual instance of a Windows server. (https://code.sololearn.com/cSGs2TtI0Lqm ) Pythonā€™s sleep is also accurate enough for our use: https://stackoverflow.com/questions/1133857/how-accurate-is-pythons-time-sleep. So the question is can we programmatically determine where that value is coming from. Whether it is a code judge or a system timeout be a good challenge to see if we can determine that. Iā€™ll post here if I find more but please go ahead if you find more as well.
1st Jan 2018, 4:08 AM
cyber33
cyber33 - avatar
+ 9
@dimon2101, did some research with caveats :-) There is no validity to this answer, just a possible way things might have been done. We know that SoloLearn has an online compiler in various languages. An example of another WebSite that uses an online compiler is IDEOne (https://ideone.com/). The engine behind the compiler is in this case Sphere-engine (https://sphere-engine.com/). Sphere engine is not just a compiler but can also judge the code submitted by the user. The Sphere OnLine Judge is a good example of the full use of the engine for obvious reasons (http://www.spoj.com/). Each problem there has a Time Limit parameter (not sure how it is set) but obviously configurable since the time complexities can vary depending on the problem presented. So that being the case we can imagine that we could set the submissions as problems that we don't judge except for time, memory used, compiler issues, and runtime issues. We can also imagine some performance metric on the overall infrastructure to vary the time limit or memory within a certain range so "correct" code does not get kicked out... so to speak... just some ramblings
29th Dec 2017, 3:47 PM
cyber33
cyber33 - avatar
+ 8
@Jason what questions do you have... post them here and I will try :-) to answer them...
29th Dec 2017, 2:53 PM
cyber33
cyber33 - avatar
+ 8
@dimon2101, interesting question, the SL folks might know... there might be a programmatic way to figure it out but just by experience I think it varies, which leads me to believe there is an acceptable range and if the overall SL architecture is loaded it might reduce that time. Iā€™m just going by observation as I donā€™t have SL internals knowledge but just general ones about managing load... another research item for me :-)
29th Dec 2017, 2:57 PM
cyber33
cyber33 - avatar
+ 6
Also too, SoloLearn limits your resources so you could have a valid program and have it run out of allocated resource like memory, swap space, running time, etc. Likely SL servers are clustered but to make it fair for the 18+ million learners and have one user hog all the resources, SL likely limits each user to a specific amount of resources and running time. Otherwise SL will go down quite often. So some wiseguy or girl won't enter an infinite loop and doing some random complext calculation and throwing it away and laughing their heads off because we can't login anymore... until the SL system adminstrator's phone pager goes off and their sleep is interrupted. For instance this is a valid Python program that runs find on my iPad... it prints out 35,660 digits: import math print(factorial(10000)) However in the SoloLearn Python environment I get "Time limit exceeded" So you can try your program on a computer or pad device. Also it runs fine with factorial(1000) keeping input number 10 times smaller for factorial computation. Just my thought about that... UPDATE: If you want, you can show us your program to examine and we can run it on our devices and see what happens.
28th Sep 2017, 1:57 AM
cyber33
cyber33 - avatar
+ 5
The SL Code Playground server imposes a time limit to prevent infinite loops. If you search for "exceeded" in the Q&A search box you will see quite a few threads on the subject.
27th Sep 2017, 11:03 PM
David Ashton
David Ashton - avatar
+ 5
Sorry for brutal and dumb design, but for me in python time limit is 4.95 sec https://code.sololearn.com/c4wOt3WZny7g/?ref=app
29th Dec 2017, 10:17 PM
dimon2101
dimon2101 - avatar
+ 3
Means that the code takes too long to finish executing, either an inefficient code or infinite loop
27th Sep 2017, 11:12 PM
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬
šŸ‘‘ Prometheus šŸ‡øšŸ‡¬ - avatar
+ 2
Does anyone knows the value of time limit (in seconds) in SL ??
29th Dec 2017, 12:37 PM
dimon2101
dimon2101 - avatar