{"description":"\u30a8\u30e9\u30c8\u30b9\u30c6\u30cd\u30b9\u306e\u3075\u308b\u3044\u3067\u3059\u3002\u3075\u3064\u3046\u306b\u66f8\u3044\u3066\u307f\u307e\u3059\u3002 def sieve1(N :Int) :List[Int] = { val a = new Array[Boolean](N + 1) for(n <- 2 to N) a(n) = true for(p <- Iterator.range(2, N + 1).takeWhile(p => p * p <= N) if a(p); k <- Iterator.range(p * 2, N + 1, p)) a(k) = false List.range(2, N + 1).filter(n => a(n)) } 45ms\u3067\u3057\u305f\u3002Python\u306e\u2026","provider_url":"https://hatena.blog","published":"2011-10-21 00:00:00","height":"190","title":"Scala\u3067\u7d20\u6570\u5224\u5b9a\uff082\uff09","url":"https://inamori.hateblo.jp/entry/20111021/p1","author_name":"inamori","blog_url":"https://inamori.hateblo.jp/","categories":["\u6570\u5b66","\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0","Scala"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20111021%2Fp1\" title=\"Scala\u3067\u7d20\u6570\u5224\u5b9a\uff082\uff09 - 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>","width":"100%","blog_title":"inamori\u2019s diary","version":"1.0","provider_name":"Hatena Blog","type":"rich","author_url":"https://blog.hatena.ne.jp/inamori/","image_url":null}