[Tutor] OverflowError in lucky numbers script

Peter Otten __peter__ at web.de
Mon Jan 23 09:13:13 CET 2012


Shreesh bhat wrote:

> Thank you all for helping me understand the overflow error.
> I m a newbie on mailing lists.I apologize for my errors.
> Program:

[snip code]

> The program is executing correctly but it has to execute 16 seconds for
> the constraints.
> I have optimized the way i sum up digits and used "consult-table"
> approach. Still the program doesn't reach the 16 seconds target.
> How to achieve this target?

What is the exact dataset for which you are trying to reach that execution 
time limit? Please give the values for start and end numbers.

How far off is your current solution, i. e. how many seconds does it need to 
finish?

I am asking because if you are almost there it makes sense to try and 
optimise your current script a little more, but if you are orders of 
magnitude away from your goal you may need a completely different approach.



More information about the Tutor mailing list