Sum of digits of a factorial

后端 未结 10 715
囚心锁ツ
囚心锁ツ 2020-12-07 10:06

Link to the original problem

It\'s not a homework question. I just thought that someone might know a real solution to this problem.

I was on

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 10:30

    1 second? Why can't you just compute n! and add up the digits? That's 10000 multiplications and no more than a few ten thousand additions, which should take approximately one zillionth of a second.

提交回复
热议问题