{"provider_name":"Hatena Blog","image_url":null,"blog_url":"https://inamori.hateblo.jp/","published":"2013-07-09 00:00:00","version":"1.0","url":"https://inamori.hateblo.jp/entry/20130709/p1","author_url":"https://blog.hatena.ne.jp/inamori/","author_name":"inamori","blog_title":"inamori\u2019s diary","title":"C#\u3067Project Euler\uff086\uff09 \u53cd\u5fa9\u5b50\u30d6\u30ed\u30c3\u30af","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20130709%2Fp1\" title=\"C#\u3067Project Euler\uff086\uff09 \u53cd\u5fa9\u5b50\u30d6\u30ed\u30c3\u30af - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"\u30bf\u30a4\u30c8\u30eb\u306f\u3001\u82f1\u8a9e\u3067\u306fiterator block\u3001\u65e5\u672c\u8a9e\u516c\u5f0f\u30b5\u30a4\u30c8\u3067\u306f\u53cd\u5fa9\u5b50\u30d6\u30ed\u30c3\u30af\u3068\u547c\u3093\u3067\u3044\u308b\u3088\u3046\u3067\u3059\uff08\u65b9\u6cd5 : \u6574\u6570\u30ea\u30b9\u30c8\u306e\u53cd\u5fa9\u5b50\u30d6\u30ed\u30c3\u30af\u3092\u4f5c\u6210\u3059\u308b (C#)\uff09\u3002\u53cd\u5fa9\u5b50\u30d6\u30ed\u30c3\u30af\u306fPython\u3067\u3044\u3046\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u4f8b\u3068\u3057\u3066Problem 2\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002 from itertools import * def fibs(): a, b = 0, 1 while True: yield b a, b = b, a + b N = 4 * 10 ** 6 print sum(f for f in takewhile(lambda f: f <= N, fibs()) if f\u2026","width":"100%","categories":["C#"],"height":"190","type":"rich","provider_url":"https://hatena.blog"}