Quantcast
Channel: Prime Generator TLE; How can I speed up my code? (Python 3.4)
Browsing all 6 articles
Browse latest View live

Prime Generator TLE; How can I speed up my code? (Python 3.4)

@jlonexshot wrote: Hi guys, I have been trying to implement the Sieve of Eratosthenes to solve this problem but I am not sure I have done it correctly as I keep getting a TLE. What can I do to improve...

View Article


Prime Generator TLE; How can I speed up my code? (Python 3.4)

@safari2477 wrote: You can try this: Only consider odd numbers: rangeOfNumbers = list( range( minOdd, max+1, 2)) After sieve:consider prime number 2 if min <=2 Read full topic

View Article


Prime Generator TLE; How can I speed up my code? (Python 3.4)

@jlonexshot wrote: Thanks! That helped, It was accepted! Read full topic

View Article

Prime Generator TLE; How can I speed up my code? (Python 3.4)

@jlonexshot wrote: Hi guys, I have been trying to implement the Sieve of Eratosthenes to solve this problem but I am not sure I have done it correctly as I keep getting a TLE. What can I do to improve...

View Article

Prime Generator TLE; How can I speed up my code? (Python 3.4)

@safari2477 wrote: You can try this: Only consider odd numbers: rangeOfNumbers = list( range( minOdd, max+1, 2)) After sieve:consider prime number 2 if min <=2 Read full topic

View Article


Prime Generator TLE; How can I speed up my code? (Python 3.4)

@jlonexshot wrote: Thanks! That helped, It was accepted! Read full topic

View Article
Browsing all 6 articles
Browse latest View live