摘要: 例题素数密度 template<typename T> struct segment_sieve { vector<bool> is_prime, is_prime_small; vector<T> prime; segment_sieve() { is_prime.resize(1000010); 阅读全文
posted @ 2023-12-16 16:27 Ke_scholar 阅读(7) 评论(0) 推荐(0) 编辑
摘要: bool isPrime(int x) { if (x <= 3) return x > 1; if (x % 6 != 1 && x % 6 != 5) return false; int n = sqrt(x); for (int i = 5; i <= n; i += 6) if (x % i 阅读全文
posted @ 2023-12-16 15:07 Ke_scholar 阅读(7) 评论(0) 推荐(0) 编辑