当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
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;
}边栏推荐
- TCP两次挥手,你见过吗?那四次握手呢?
- Machine learning concept drift detection method (Apria)
- Scala基础教程--17--集合
- 基于unity的愤怒的小鸟设计
- Li Kou brush question diary /day6/6.28
- Halcon template matching
- Scala basic tutorial -- 12 -- Reading and writing data
- [211] go handles the detailed documents of Excel library
- [go language question brushing chapter] go conclusion chapter | introduction to functions, structures, interfaces, and errors
- 一直以为做报表只能用EXCEL和PPT,直到我看到了这套模板(附模板)
猜你喜欢

My colleagues quietly told me that flying Book notification can still play like this

What types of Thawte wildcard SSL certificates provide

Basic tutorial of scala -- 16 -- generics

I always thought that excel and PPT could only be used for making statements until I saw this set of templates (attached)

Nature Microbiology | 可感染阿斯加德古菌的六种深海沉积物中的病毒基因组

基于NCF的多模块协同实例

ThreadLocal原理与使用

Reptile elementary learning

How is the entered query SQL statement executed?

激进技术派 vs 项目保守派的微服务架构之争
随机推荐
Halcon模板匹配
Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg
ITSS运维能力成熟度分级详解|一文搞清ITSS证书
【Go语言刷题篇】Go完结篇|函数、结构体、接口、错误入门学习
android使用SQLiteOpenHelper闪退
Is it safe to download the mobile version of Anxin securities and open an account online
力扣刷题日记/day1/2022.6.23
Scala basic tutorial -- 13 -- advanced function
学习路之PHP--phpstudy创建项目时“hosts文件不存在或被阻止打开”
Principle and application of ThreadLocal
2022年字节跳动日常实习面经(抖音)
一直以为做报表只能用EXCEL和PPT,直到我看到了这套模板(附模板)
Redis master-slave replication
6.26cf simulation race e: solution to the problem of price maximization
[209] go language learning ideas
被忽视的问题:测试环境配置管理
The block:usdd has strong growth momentum
Blue bridge: sympodial plant
My colleagues quietly told me that flying Book notification can still play like this
Scala basic tutorial -- 12 -- Reading and writing data