{"author_name":"inamori","categories":["PE","\u6570\u5b66","\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"],"version":"1.0","height":"190","published":"2010-07-23 00:00:00","provider_url":"https://hatena.blog","type":"rich","url":"https://inamori.hateblo.jp/entry/20100723/p1","blog_title":"inamori\u2019s diary","blog_url":"https://inamori.hateblo.jp/","author_url":"https://blog.hatena.ne.jp/inamori/","width":"100%","title":"Project Euler 134","description":"http://projecteuler.net/index.php?section=problems&id=134 p1 = 19\u3001p2 = 23\u3068\u3059\u308b\u3068\u3001 100x + p1 = p2y \u3068\u3044\u3046\u4e0d\u5b9a\u65b9\u7a0b\u5f0f\u3092\u89e3\u304f\u3060\u3051\u3067\u3059\u3002 Python\u306b\u306ftee\u3068\u3044\u3046\u95a2\u6570\u304c\u3042\u308b\u306e\u3067\u3059\u306d\u3002 from itertools import tee def gen(): for n in xrange(10): print n yield n g1, g2 = tee(gen()) print sum(g1) print sum(g2) 2\u3064\u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u304c\u4f5c\u3089\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u8a08\u7b97\u3092\u3059\u308b\u306e\u306f1\u56de\u3060\u3051\u3067\u3001\u30ea\u30b9\u30c8\u304b\u306a\u306b\u304b\u306b\u5024\u3092\u2026","provider_name":"Hatena Blog","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20100723%2Fp1\" title=\"Project Euler 134 - 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>"}