src/Math/Eratosthenes.hpp
概要
エラトステネスの篩による素数列挙。
計算量は、n以下の素数の逆数和がO(loglog n)であることから、O(n loglog n)である(参考: https://mathtrain.jp/eratosthenes)。
定数倍高速化を頑張るともっとかなり早くなる(参考: https://qiita.com/peria/items/a4ff4ddb3336f7b81d50)
Verified with
Code
Back to top page