摘要:
本地测试结果是,第三种方法速度最快,而且可以直接判断给定的数是否素数。 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <cstring> 5 #include <cmath> 6 7 using namespace std; 8 9 const int N = 111111111;10 int prm[6666666], pn, np[N >> 6];11 bool mp[N];12 13 void getPrm1() 阅读全文