
其他
文章平均质量分 72
CLamb
good good study!day day up!
展开
-
2021湘潭全国邀请赛 J题 Stacks
Stacks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/262144 K (Java/Others) Total Submission(s): 226 Accepted Submission(s): 39 Problem Description There are N stacks, numbered from 1 to N. Initially, the i-th stack only contains a numbe原创 2021-07-19 11:13:56 · 465 阅读 · 0 评论 -
素数筛【埃筛,欧拉筛(线性筛)】
素数筛 转载:https://blog.youkuaiyun.com/dy416524/article/details/86431057 枚举所有小于数,看是否它能整除其他自然数,但实际上只需要枚举根号次。 bool Is_prime(int n) { for(int i=1;i*i<=n;++i) { if(n%i==0) return false; } return true; } •埃氏筛:做法其实很简单,首先将2到n范围内的整数写下来,其中2是最小的素数。转载 2020-07-23 11:05:11 · 253 阅读 · 0 评论