摘要: P3383 【模板】线性筛素数 来源:洛谷 https://www.luogu.com.cn/problem/P3383 这题考 [素数筛] ,但数据范围很毒瘤,100%数据n=10^8,意味着只有 [线性筛] 才能AC 以下提供3种素数筛法 ①朴素算法(时间复杂度O(n*sqrt(n)) 1 #i 阅读全文
posted @ 2021-08-19 23:28 九州霜 阅读(92) 评论(1) 推荐(0) 编辑
摘要: 1 #include <bits/stdc++.h> 2 using namespace std; 3 int read(){ 4 int flag=0,x=0; 5 char a=getchar(); 6 while(a<'0'||a>'9'){ 7 if(a=='-')flag=1; 8 a=g 阅读全文
posted @ 2021-08-19 08:53 九州霜 阅读(49) 评论(0) 推荐(0) 编辑