ICPC North America Qualifier 2016, Problem G
A factorial
It is straightforward to calculate the factorial of a small integer, and you have probably done it many times before. In this problem, however, your task is reversed. You are given the value of
Input Specification
The input contains the factorial
Output Specification
Output the value of
Sample Input 1
Copy
120
Sample Output 1
Copy
5
Sample Input 2
Copy
51090942171709440000
Sample Output 2
Copy
21
Sample Input 3
Copy
10888869450418352160768000000
Sample Output 3
Copy
27
Comments
The time control is quite tight.
You have not implemented the correct solution to this problem. Both Java's and Python's support for large integers still doesn't allow for direct brute-forcing to get the answer. Try thinking of a different approach.