当前位置:网站首页>模板_判断素数_开方 / 六素数法
模板_判断素数_开方 / 六素数法
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;
}边栏推荐
- vbs或vbe如何修改图标
- LD_ LIBRARY_ Path environment variable setting
- [211] go handles the detailed documents of Excel library
- How to download files using WGet and curl
- 蓝桥:合根植物
- 1、 Introduction to C language
- 基于C语言的菜鸟驿站管理系统
- Summary of subsidy policies across the country for dcmm certification in 2022
- Blue bridge: sympodial plant
- Angry bird design based on unity
猜你喜欢

删除二叉搜索树中的节点附图详解

TorchDrug教程

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

Li Kou brush question diary /day7/2022.6.29

Torchdrug tutorial

2022 national CMMI certification subsidy policy | Changxu consulting

Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg

2022年字节跳动日常实习面经(抖音)

How is the entered query SQL statement executed?

Li Kou brush question diary /day6/6.28
随机推荐
Pb extended DLL development (super chapter) (VII)
Scala basic tutorial -- 20 -- akka
I wrote a learning and practice tutorial for beginners!
技术分享 | 接口测试价值与体系
Journal des problèmes de brosse à boutons de force / day6 / 6.28
General environmental instructions for the project
Load test practice of pingcode performance test
An example of multi module collaboration based on NCF
TCP两次挥手,你见过吗?那四次握手呢?
中国农科院基因组所汪鸿儒课题组诚邀加入
What if the self incrementing ID of online MySQL is exhausted?
输入的查询SQL语句,是如何执行的?
android使用SQLiteOpenHelper闪退
The block:usdd has strong growth momentum
Interview summary of large factory Daquan II
[HCIA continuous update] WAN technology
Scala basic tutorial -- 19 -- actor
力扣刷题日记/day1/2022.6.23
Nature microbiology | viral genomes in six deep-sea sediments that can infect Archaea asgardii
1、 Introduction to C language