stone-zeng / stone-zeng.site

Personal website of Xiangdong Zeng
https://stone-zeng.site
Creative Commons Attribution Share Alike 4.0 International
12 stars 5 forks source link

Project Euler (11–20) | stone-zeng.github.io #23

Closed stone-zeng closed 9 months ago

stone-zeng commented 4 years ago

https://stone-zeng.github.io/2020-08-07-euler-11-20/

欧拉计划 11–20 题。

muyuuuu commented 4 years ago

大佬太强了。

muyuuuu commented 4 years ago

最后一题,用 C++ 写直接乘法,我估计不出5个数就溢出了,MMA 是有什么神奇操作吗?

muzimuzhi commented 4 years ago

最后一题,用 C++ 写直接乘法,我估计不出5个数就溢出了,MMA 是有什么神奇操作吗?

根据 MMA 的文档 https://reference.wolfram.com/language/ref/Factorial.html

Factorial can be evaluated to arbitrary numerical precision.

stone-zeng commented 4 years ago

Some Notes on Internal Implementation 中可以看到这样的说明:

n! uses an O(log(n)M(n)) algorithm of Schönhage based on dynamic decomposition to prime powers.