jothin's blog

By jothin, history, 2 months ago, In English

Problem link

My solution that is supposed to get a TLE but got AC instead

Generator script for the test case that could trigger a TLE:

from math import isqrt
N=10**6
sieve=[True]*(N+1)
for i in range(2,isqrt(N)+1):
    if not sieve[i]:continue
    for j in range(i**2,N+1,i):
        sieve[j]=False
sieve[0]=sieve[1]=False
primes=[x for x in range(2,N) if sieve[x]]
print(1)
print(len(primes),1000000)
print(*primes)
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
2 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by jothin (previous revision, new revision, compare).