> Any ideas to speed it up say 10 times? Or the problem only for C-like
> langs?

I dout this will speed it up by a factor of 10, but in your solution
you are mapping the values in the input file to longs. The problem
statement states that the maximum value for any of the numbers is
2**28. I assume the reason for this is precisely to allow you to use
32-bit integers. So, you can safely use int instead, and it _might_
speed up a little.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to