当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
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;
}边栏推荐
- 网上开户安全吗?是真的吗?
- 一种将Tree-LSTM的强化学习用于连接顺序选择的方法
- I always thought that excel and PPT could only be used for making statements until I saw this set of templates (attached)
- MySQL common add, delete, modify and query operations (crud)
- 谷粒商城(一)
- Angry bird design based on unity
- Scala basic tutorial -- 17 -- Collection
- 【Go语言刷题篇】Go完结篇|函数、结构体、接口、错误入门学习
- Scala basic tutorial -- 15 -- recursion
- Scala基础教程--13--函数进阶
猜你喜欢

力扣刷题日记/day7/2022.6.29

Wireshark抓包TLS协议栏显示版本不一致问题

力扣刷题日记/day1/2022.6.23

.NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)

力扣刷题日记/day2/2022.6.24

Halcon template matching

How to modify icons in VBS or VBE

ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development

Numpy 的仿制 2

Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
随机推荐
Thawte通配符SSL证书提供的类型有哪些
1、 Introduction to C language
Just today, four experts from HSBC gathered to discuss the problems of bank core system transformation, migration and reconstruction
Mysql5.7 installation tutorial graphic explanation
How to open an account is safe,
VMware Tools和open-vm-tools的安装与使用:解决虚拟机不全屏和无法传输文件的问题
Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
力扣刷题日记/day8/7.1
Summary of subsidy policies across the country for dcmm certification in 2022
技术分享 | 接口测试价值与体系
TorchDrug教程
LD_LIBRARY_PATH 环境变量设置
输入的查询SQL语句,是如何执行的?
Blue bridge: sympodial plant
Caché JSON 使用JSON适配器
Behind the ultra clear image quality of NBA Live Broadcast: an in-depth interpretation of Alibaba cloud video cloud "narrowband HD 2.0" technology
ESP32-C3入门教程 问题篇⑫——undefined reference to rom_temp_to_power, in function phy_get_romfunc_addr
Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
My colleagues quietly told me that flying Book notification can still play like this
大厂面试总结大全二