hdu Largest prime factor
2024-09-15 20:30:12
类似于素数打表。
#include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 1000100
using namespace std; int f[maxn]; void inti()
{
int num=;
for(int i=; i<maxn; i++)
{
if(f[i]==)
{
num++;
for(int j=i; j<maxn; j+=i)
{
f[j]=num;
}
}
}
} int main()
{
int n;
inti();
while(scanf("%d",&n)!=EOF)
{
printf("%d\n",f[n]);
}
return ;
}
最新文章
- web.xml文件加载顺序
- Finalize()、Dispose()、SafeHandle、GC
- python install_opener用法
- char(10)和VARCHAR(10)主要的区别是什么?
- [Stanford 2011] Views 知识点
- UVa 1595 (水题) Symmetry
- CSS3 transition 属性 过渡效果
- hibernate 连接数据库时报错
- 使用AlarmManager进行定时任务处理
- react-native 环境配置及hello world
- ElasticSearch(7)-排序
- Java反射机制剖析(一)-定义和API
- jssdk防覆盖
- 从零开始学安全(三十三)●Ununtu16 LMAP 环境搭建
- Cordova Error: cmd: Command failed with exit code ENOENT
- Linux 上pcntl安装步骤
- python --- 13 内置函数
- 在string资源中添加变量
- 【WP8.1】系统控件的bug及修复方案
- Sticker.js生成图片或者页面元素“速干贴”效果
热门文章
- 【转】Linux下tar.xz结尾的文件的解压方法
- 美国易安信公司 EMC
- JS-Date日期内置对象
- writev/readv
- [原创]安卓使用Termux做渗透测试(演示sqlmap安装,并附上一个神器)
- React Native 初识
- Java虚拟机之垃圾回收详解一
- PHP设计模式笔记六:数据对象映射模式 -- Rango韩老师 http://www.imooc.com/learn/236
- java.util.Map.Entry接口
- myPagination5.0 分页简单实例