Created
September 17, 2012 08:33
-
-
Save masahixixi/3736192 to your computer and use it in GitHub Desktop.
ProjectEuler #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lcmnum = 11 | |
(12..20).each do |num| | |
lcmnum = lcmnum.lcm(num) | |
end | |
p lcmnum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
問題文は、
なので、11〜20みたいな小細工は必要ないと思う。
よっぽどパフォーマンスが求められている状況でない限り、汎用的でない最適化はあまりよろしくないかと。