摘要: 线性筛。注意循环终止条件不要写成判断,否则及影响效率又可能导致re 1 for(int i = 2;i <= m;i++){ 2 if(!not_p[i])prime[++cntp] = i; 3 for(int j = 1;j <= cntp;j++){ 4 if(i*prime[j] > m)b 阅读全文
posted @ 2019-10-15 23:19 TIH_HIT 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 分别预处理每行每列前缀合,然后枚举两顶点坐标即可。读取线段上值时要注意去重! 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 5 const int Maxn = 110; 6 int xs[Maxn][Maxn],y 阅读全文
posted @ 2019-10-15 11:06 TIH_HIT 阅读(159) 评论(0) 推荐(0) 编辑