当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
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;
}边栏推荐
- 2022 national CMMI certification subsidy policy | Changxu consulting
- Scala基础教程--18--集合(二)
- 1、 Introduction to C language
- TCP waves twice, have you seen it? What about four handshakes?
- 力扣刷题日记/day4/6.26
- Is it safe to open an account online? is that true?
- Deleting nodes in binary search tree
- 【211】go 处理excel的库的详细文档
- Li Kou brush question diary /day4/6.26
- 6.26cf simulation race e: solution to the problem of price maximization
猜你喜欢
随机推荐
如何使用 wget 和 curl 下载文件
Scala basic tutorial -- 18 -- set (2)
Mysql5.7 installation tutorial graphic explanation
【云端心声 建议征集】云商店焕新升级:提有效建议,赢海量码豆、华为AI音箱2!
Scala basic tutorial -- 19 -- actor
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
激进技术派 vs 项目保守派的微服务架构之争
fopen、fread、fwrite、fseek 的文件处理示例
【Go语言刷题篇】Go完结篇|函数、结构体、接口、错误入门学习
Scala基础教程--16--泛型
Deleting nodes in binary search tree
Neglected problem: test environment configuration management
The controversial line of energy replenishment: will fast charging lead to reunification?
【210】PHP 定界符的用法
输入的查询SQL语句,是如何执行的?
【2022年江西省研究生数学建模】冰壶运动 思路分析及代码实现
Esp32-c3 introductory tutorial questions ⑫ - undefined reference to ROM_ temp_ to_ power, in function phy_ get_ romfunc_ addr
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
TCP waves twice, have you seen it? What about four handshakes?








