Kalle Svensson wrote: > After quite a bit of experimentation, I finally managed to write a > program that was accepted by the judge system. It's a C++ > implementation of the deterministic Miller-Rabin algorithm. My Python > implementation of the same algorithm is still too slow, though. Has > anyone managed to write a fast enough Python program?
Have you tried using psyco? Have you seen this thread? It has some very interesting ideas about speeding up the sieve algorithm. (Uncle Timmy is Tim Peters who still has one of the fastest Python solutions.) https://www.spoj.pl/forum/viewtopic.php?t=3226 Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor