+ 1
Can IDLE do this?
I have attached a link to my code. This always comes up as No Output, Time Limit Exceeded or (very rarely) the answer. Is my program wrong or is it just Sololearn? https://code.sololearn.com/cG2XlpbDzwM2/?ref=app
17 Respuestas
+ 9
@Pegasus the higher the passes, there is more chances of timeout. Tried more scenarios of timeout.
+ 7
Works for me. Entered 30. Retrieve in 13 passes.
+ 6
It works with no problem.
Sometimes the sololearn server is busy.
In this case you get a timout even your prog is ok.
+ 5
Timeout has to do with the code taking like maybe 5 seconds or smthing like that to run
+ 5
Ues but even if one case fails, it means the whole thing is wrong
+ 5
thats it!
working examples are necessary conditions for a correct algorithm.
one not working example is a sufficient condition for a not working algorithm.
+ 4
Even if it takes an infinite amount of time to do so, IDLE WILL do it.
But this also shows your algorithm is pretty inefficient.
+ 4
@Apoorva try 715
+ 4
@Max somethings going wrong..,
try this with 499 and you will see
https://code.sololearn.com/cvKK2oH6s4oq/?ref=app
+ 4
715 is a magical number. A good test case.
Both failed.
Binary search is quite inefficient
+ 4
A nice case of:
even if many examples work, it is not a proof that the Algorithm is correct.
+ 4
@Max see comments in my code. Might be the solution
+ 4
@Max indeed!
The operator // returns an integer
+ 2
Ok.
+ 1
Oh ok thanks.
0
Ok will change it. Thanks for feedback. :)
0
Fixed it.