{"type":"rich","blog_title":"atsuoishimoto's diary","provider_url":"https://hatena.blog","image_url":null,"height":"190","author_name":"atsuoishimoto","url":"https://atsuoishimoto.hatenablog.com/entry/20101113/1289746045","categories":["Python","Cython"],"version":"1.0","author_url":"https://blog.hatena.ne.jp/atsuoishimoto/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fatsuoishimoto.hatenablog.com%2Fentry%2F20101113%2F1289746045\" title=\"Cython \u6f14\u7fd2\u554f\u984c - atsuoishimoto&#39;s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2010-11-13 23:47:25","width":"100%","provider_name":"Hatena Blog","blog_url":"https://atsuoishimoto.hatenablog.com/","title":"Cython \u6f14\u7fd2\u554f\u984c","description":"\u6f14\u7fd21 - \u7d20\u6570\u5224\u5b9a (A) \u4ee5\u4e0b\u306ePython\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u3001 primes(1000) \u306e\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u51e6\u7406\u6642\u9593\u3092\u6e2c\u5b9a\u305b\u3088\u3002 def primes(kmax): p = [0] * kmax result = [] k = 0 n = 2 while k < kmax: i = 0 while i < k and n % p[i] <> 0: i = i + 1 if i == k: p[k] = n k = k + 1 result.append(n) n = n + 1 return result (B) (A)\u3067\u4f5c\u6210\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092 primes1.pyx\u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057\u3001Cyt\u2026"}