Skip to content

Commit 6275d95

Browse files
authored
O(n*lg(lg(n)))
1 parent 867bb26 commit 6275d95

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

All_prime.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Sieve Theorem
22
from math import *
33

4-
def primes(n):
4+
def all_primes(n):
55
pr = [True] * (n+1)
66
pr[0] = False
77
pr[1] = False
@@ -13,6 +13,5 @@ def primes(n):
1313
if pr[i] == True:
1414
print(i, end=" ")
1515

16-
for _ in range(int(input())):
17-
n = int(input())
18-
primes(n)
16+
n = int(input())
17+
print(all_primes(n))

0 commit comments

Comments
 (0)