A simple iterative multiplicative approach can get AC here taking ~4.5 seconds. No prime factorization needed, other than recognizing the trick with 2s and 5s.
However, if your approach is O(c*f(n)), c matters here. Example: if my solution was tripled then it would get TLE. (hint: only use one loop)
Search found 1 match
Search found 1 match • Page 1 of 1