Sort 5 Discussions, By:
Please Login in order to post a comment
My program finds 13!'s divisors 66528 and 93600 (among others) because their successor is a prime and combines them.
Sorting those roughly 180000 numbers finishes almost instantly but I went the crazy way and preferred ''std::nth_element'' because it is a little bit more efficient - but you can't measure the performance advantage
can anyone explain the question?
To check the cardinality ("checksum") of your sets ϕ-1(m), consider these resources I used:
In Python testcases, the limit for time is 20 seconds and memory is 512 megabytes. My Python3 code runs under 360 milliseconds; its own prime factorization uses memo-ization.
from math import factorial
while q != 0:
p, q = q, p%q
def is_coprime(x, y):
return gcd(x, y) == 1
for i in range(n-1,2,-1):
this code is working for smaller values but with the inputs of the problem it is showing time out please help
No more comments