会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
standard_zsz
博客园
首页
新随笔
联系
订阅
管理
2021年2月17日
质数、约数
摘要: 质数的判定——试除法 时间复杂度O(sqrt(n)) 写sqrt(n)比较慢,i*i<=n容易溢出 bool is_prime(int x) { if(x<2) return false; for(int i=2;i<=x/i;i++) if(x%i==0) return false; return
阅读全文
posted @ 2021-02-17 12:17 standard_zsz
阅读(18)
评论(0)
推荐(0)
公告