{"title":"\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u4e92\u9664\u6cd5\u3063\u3066\u901f\u3044\u306e\u304b\u3057\u3089 ","published":"2010-05-27 00:00:00","height":"190","provider_url":"https://hatena.blog","description":"Project Euler 108\u554f\u76ee\u3002n\u304c\u4e0e\u3048\u3089\u308c\u305f\u3068\u304d\u3001 1/x + 1/y = 1/n\u3092\u6e80\u305f\u3059\u3001x\u3001y\u306e\u30e6\u30cb\u30fc\u30af\u306a\u7d44\u307f\u5408\u308f\u305b\u6570\u3092\u8abf\u3079\u308b\u3002\u521d\u3081\u3066\u7d44\u307f\u5408\u308f\u305b\u6570\u304c1000\u3092\u8d85\u3048\u308bn\u306f\u3044\u304f\u3064\u304b\uff1fRuby\u306eComparable\u307f\u305f\u3044\u306a\u3082\u306e\u3092\u4f7f\u3063\u3066\u307f\u305f\u304b\u3063\u305f\u3053\u3068\u3082\u3042\u3063\u3066\u3001\u5206\u6570\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u30d6\u30eb\u30fc\u30c8\u30d5\u30a9\u30fc\u30b9\u3067\u3084\u3063\u3066\u307f\u305f\u3002gcd\u3068\u304blcm\u306f\u3042\u3048\u3066\u518d\u767a\u660e\u3068\u3044\u3046\u304b\u81ea\u5206\u3067\u66f8\u3044\u3066\u307f\u305f\u3002 module MyMath def gcd(a, b) if (b == 0) then a else gcd(b, (a % b)) end end def lcm(a, b) a * b / gcd(a, b) end en\u2026","type":"rich","image_url":null,"provider_name":"Hatena Blog","author_name":"yarb","width":"100%","version":"1.0","blog_url":"https://yarb.hatenadiary.org/","categories":["ruby","euler"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyarb.hatenadiary.org%2Fentry%2F20100527%2Fp1\" title=\"\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u4e92\u9664\u6cd5\u3063\u3066\u901f\u3044\u306e\u304b\u3057\u3089  - yarb\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"yarb\u306e\u65e5\u8a18","author_url":"https://blog.hatena.ne.jp/yarb/","url":"https://yarb.hatenadiary.org/entry/20100527/p1"}