当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
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;
}边栏推荐
- Li Kou brush question diary /day2/2022.6.24
- Scala基础教程--17--集合
- Halcon template matching
- Unity 制作旋转门 推拉门 柜门 抽屉 点击自动开门效果 开关门自动播放音效 (附带编辑器扩展代码)
- Halcon模板匹配
- Android uses sqliteopenhelper to flash back
- 提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
- 2022 national CMMI certification subsidy policy | Changxu consulting
- 谷粒商城(一)
- 6.26cf simulation match B: solution to array reduction problem
猜你喜欢

Blue bridge: sympodial plant

Li Kou brush question diary /day4/6.26

Deleting nodes in binary search tree

基于lex和yacc的词法分析器+语法分析器

Scala基础教程--18--集合(二)

Scala basic tutorial -- 18 -- set (2)

Li Kou brush question diary /day8/7.1

蓝桥:合根植物

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

Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
随机推荐
How to modify icons in VBS or VBE
6.26cf simulation race e: solution to the problem of price maximization
Tutorial on the use of Huawei cloud modelarts (with detailed illustrations)
【Go语言刷题篇】Go完结篇|函数、结构体、接口、错误入门学习
学习路之PHP--phpstudy创建项目时“hosts文件不存在或被阻止打开”
File processing examples of fopen, FREAD, fwrite, fseek
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
Wanghongru research group of Institute of genomics, Chinese Academy of Agricultural Sciences is cordially invited to join
如何提高开发质量
如何使用 wget 和 curl 下载文件
Interpretation of SIGMOD '22 hiengine paper
My colleagues quietly told me that flying Book notification can still play like this
激进技术派 vs 项目保守派的微服务架构之争
General environmental instructions for the project
Scala basic tutorial -- 18 -- set (2)
6.26CF模拟赛B:数组缩减题解
【210】PHP 定界符的用法
力扣刷题日记/day1/2022.6.23
Digital "new" operation and maintenance of energy industry
基于unity的愤怒的小鸟设计