why is my Sieve of Eratosthenes program so slow?

前端 未结 0 889
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 01:36

why my code in Sieve of Eratosthenes is so slow but this one is so fast? they both have same logic. my code:

def sumPrimes(n):
sum, sieve = 0, [True] * n
for          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题