i'm solving EASYFACT problem; but i'm getting TLE, i don't know any fast method of prime factorization of n factorial
i'm solving using the usual method (complexity: klogk where k is the number of primes under n)
result = 1
for (int32_t x = 1, pxcount = 0; primes[x] <= n; ++x, pxcount = 0) {
for (int32_t y = primes[x]; y <= n; y *= primes[x])
pxcount += n / y;
result = (1ll * result * (pxcount + 1)) % m;
}
what should i do to solve this problem.. please help me; thanks