当前位置:网站首页>Template_ Judging prime_ Square root / six prime method
Template_ Judging prime_ Square root / six prime method
2022-07-04 20:06:00 【This question AC sleep again】
// prescribing
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;
}
// Six prime method
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;
}边栏推荐
- Wireshark network packet capture
- SSRS筛选器的IN运算(即包含于)用法
- Actual combat simulation │ JWT login authentication
- Euler function
- 记一次 .NET 某工控数据采集平台 线程数 爆高分析
- 【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
- 1002. A+b for Polynomials (25) (PAT class a)
- 1006 Sign In and Sign Out(25 分)(PAT甲级)
- 应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
- Niuke Xiaobai month race 7 who is the divine Archer
猜你喜欢

Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing

欧拉函数
牛客小白月赛7 谁是神箭手

Dark horse programmer - software testing - 09 stage 2-linux and database -31-43 instructions issued by modifying the file permission letter, - find the link to modify the file, find the file command,

C# 使用StopWatch测量程序运行时间

上线首月,这家露营地游客好评率高达99.9%!他是怎么做到的?

做社交媒体营销应该注意些什么?Shopline卖家的成功秘笈在这里!

c# .net mvc 使用百度Ueditor富文本框上传文件(图片,视频等)

Multi table operation inner join query

Development and construction of DFI ecological NFT mobile mining system
随机推荐
1002. A+b for Polynomials (25) (PAT class a)
Dark horse programmer - software testing - stage 07 2-linux and database -09-24-linux command learning steps, wildcards, absolute paths, relative paths, common commands for files and directories, file
92. (cesium chapter) cesium building layering
92.(cesium篇)cesium楼栋分层
Double colon function operator and namespace explanation
HDU 6440 2018 Chinese college student program design network competition
Jetpack Compose 教程
解密函数计算异步任务能力之「任务的状态及生命周期管理」
@Data source connection pool exhaustion caused by transactional abuse
BCG 使用之新建向导效果
线上数据库迁移的几种方法
实战模拟│JWT 登录认证
Socket programming demo II
应用实践 | 蜀海供应链基于 Apache Doris 的数据中台建设
ACM组合计数入门
Offset function and windowing function
Matrix flip (array simulation)
Kotlin classes and objects
黑马程序员-软件测试--09阶段2-linux和数据库-31-43修改文件权限字母发的说明,-查找链接修改文件,查找文件命令,链接文件,压缩解压方式,vi编辑器基本使用,
求2的n次方