### Lucas97's blog

By Lucas97, history, 8 years ago,

Hi guys, today a friend asked me about this problem. He said it was just a random problem that came to his mind. So, I don't know any OJ to submit it. Do you know any way to solve it efficienty? i.e. I know we can compute it using Java or Python, but I'm looknig for something better(Imagine you have 3s as time limit)

• +11

| Write comment?
 » 8 years ago, # |   +162 Usually when a new problems comes to your mind you shouldn't put specific constraints for it randomly and immediately, because it's not guaranteed it's solvable in those constraints.
 » 8 years ago, # |   +34 It looks like even in oeis there is no solution: link
 » 8 years ago, # | ← Rev. 2 →   -36 .
 » 8 years ago, # |   0 SpoilerDon't know if it will get past with the limit 3s though v = 0; FOR I = 1 to n v += log10(I); 
•  » » 8 years ago, # ^ |   +10 You clearly didn't understand the problem and of course it will be TLE
•  » » » 8 years ago, # ^ | ← Rev. 3 →   0 For smaller n(say, n=1000), maybe it wont be a problem. eg: if v=24.5, we can break up the number into smaller parts(maybe) and then multiply, such as 10^9 * 10^9 * 10^(6.5) . Only the last multiplicand will contribute to the final answer. Although, I'm not exactly convinced how this can be??Like Kingofnumbers said, n<=10^9 is not a good solvable limit here.
 » 8 years ago, # |   0 My experience tells me that you can solve this type of problem by using math, which will help you reduce numbers of calculation.
•  » » 8 years ago, # ^ |   0 I think this type of problem won't ask you to calculate n! (n <= 10^9) because it seems impossible to be solved in time. Calculating n! may be a part of calulating the main question.
 » 8 years ago, # | ← Rev. 4 →   -28 Hello, a member of my team used the stirling formula to find number of digits of factorail in the problem UVA 1185 and he got acceptedxd fofao_funk comment in blog http://codeforces.com/blog/entry/44112?#comment-287711. how to solve your problem and I understand omega(n) time complexity algorithm to sum number of digits of n!.
•  » » 8 years ago, # ^ |   -11 This is not what op asked..
•  » » » 8 years ago, # ^ |   -18 Thanks, I forgot the other blog, I just modified the comment.