当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
2022-07-04 17:14:00 【这题AC再睡.】
// 开方
bool f( int n )
{
if( n<=3 ) return n>1;
for( int i=2;i<=n/i;i++ )
if( n%i==0 ) return false;
return true;
}
// 六素数法
bool f( int n )
{
if( n<=3 ) return n>1;
if( n%2==0 || n%3==0 ) return false;
for( int i=5;i<=n/i;i+=6 )
if( n%i==0 || n%(i+2)==0 ) return false;
return true;
}边栏推荐
- 如何提高开发质量
- Caché JSON 使用JSON适配器
- How to download files using WGet and curl
- An example of multi module collaboration based on NCF
- [mathematical modeling of graduate students in Jiangxi Province in 2022] analysis and code implementation of haze removal by nucleation of water vapor supersaturation
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- Is it safe to download the mobile version of Anxin securities and open an account online
- 线上MySQL的自增id用尽怎么办?
- 删除二叉搜索树中的节点附图详解
- Scala基础教程--12--读写数据
猜你喜欢

蓝桥:合根植物

Scala基础教程--17--集合

Scala基础教程--13--函数进阶

TCP两次挥手,你见过吗?那四次握手呢?
![[HCIA continuous update] WAN technology](/img/31/8e9ed888d22b15eda5ddcda9b8869b.png)
[HCIA continuous update] WAN technology

激进技术派 vs 项目保守派的微服务架构之争

Microservice architecture debate between radical technologists vs Project conservatives

VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题

Unity makes revolving door, sliding door, cabinet door drawer, click the effect of automatic door opening and closing, and automatically play the sound effect (with editor extension code)

2022年字节跳动日常实习面经(抖音)
随机推荐
Scala basic tutorial -- 19 -- actor
6.26CF模拟赛E:价格最大化题解
Grain Mall (I)
General environmental instructions for the project
Interview summary of large factory Daquan II
Scala基础教程--14--隐式转换
ITSS运维能力成熟度分级详解|一文搞清ITSS证书
如何提高开发质量
李迟2022年6月工作生活总结
【2022年江西省研究生数学建模】水汽过饱和的核化除霾 思路分析及代码实现
Li Kou brush question diary /day2/2022.6.24
【云端心声 建议征集】云商店焕新升级:提有效建议,赢海量码豆、华为AI音箱2!
TCP waves twice, have you seen it? What about four handshakes?
Li Kou brush question diary /day7/2022.6.29
vbs或vbe如何修改图标
I always thought that excel and PPT could only be used for making statements until I saw this set of templates (attached)
力扣刷题日记/day7/2022.6.29
uni-app与uviewUI实现仿小米商城app(附源码)
Just today, four experts from HSBC gathered to discuss the problems of bank core system transformation, migration and reconstruction
How to modify icons in VBS or VBE