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)
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.
It looks like even in oeis there is no solution: link
.
Don't know if it will get past with the limit 3s though
You clearly didn't understand the problem and of course it will be TLE
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.
My experience tells me that you can solve this type of problem by using math, which will help you reduce numbers of calculation.
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.
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 accepted
xd fofao_funk comment in blog http://codeforces.net/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!.
link to problem: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=3626
reference: https://es.wikipedia.org/wiki/F%C3%B3rmula_de_Stirling
This is not what op asked..
Thanks, I forgot the other blog, I just modified the comment.