LENGFACT - Factorial length
Given integer n, print length of n! (which is factorial of n).
The first line of the standard input contains one integer t (t < 10001) which is the number of test cases.
In each of the next t lines there is number n (0 <= n <= 5*10^9).
For each test, print the length of n! (which is factorial of n).
Simply formula based, AC in 0.02
i use kamenertsky ...my code give correct ans to all testcase of spoj toolkit on ideone but i get WA on spoj.need help??
Pay attention for test case which n is equal to 0.
easy problem , u just need to know kamenetsky's formula
worst qs shud be removed
easy one with kamenetsky algo.
Kamenetsky's formula is not valid for every n. It has a counterexample at 6561101970383.
Questions like these should be moved to tutorials imho because these are completely formula based. By the way, the formula is badass.. Hats Off to Kamenetsky :)
formula based question
|Added by:||Piotr Kąkol|
|Cluster:||Cube (Intel G860)|
|Resource:||Copy of the problem: FACTLENG with different assessment|