博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
求素数的位置
阅读量:3951 次
发布时间:2019-05-24

本文共 567 字,大约阅读时间需要 1 分钟。

Everybody knows any number can be combined by the prime number. 

Now, your task is telling me what position of the largest prime factor. 
The position of prime 2 is 1, prime 3 is 2, and prime 5 is 3, etc. 
Specially, LPF(1) = 0. 

Input

Each line will contain one integer n(0 < n < 1000000). 

Output

Output the LPF(n). 

Sample Input

12345

Sample Output

01213
#include 
#include
#include
using namespace std;const int maxn=1000000+10;int p[maxn];int a[maxn];int cnt=1;void init(){ for(int i=2;i
>n) { cout<
<

 

转载地址:http://npyzi.baihongyu.com/

你可能感兴趣的文章
Linux Kernel and Android休眠与唤醒
查看>>
Android Framework 分析
查看>>
inotify -- Linux 2.6 内核中的文件系统变化通知机制
查看>>
C++和JNI的数据转换
查看>>
poll()函数的使用
查看>>
I/O多路复用详解(二)
查看>>
深入理解硬盘的Linux分区
查看>>
ARM 指令集>>跳转指令
查看>>
gpio linux 实现模型
查看>>
Linux 2440 LCD 控制器
查看>>
/sys/bus/i2c/devices下的内容与i2c_board_info结构体
查看>>
为linux虚拟机增加第二块硬盘
查看>>
Linux那些事儿之我是EHCI(2) 套路
查看>>
i2c-adapter的注册过程
查看>>
container_of()宏
查看>>
Linux设备驱动之I2C架构分析
查看>>
通信设备硬件工程师应该具备的基本能力和知识-1
查看>>
通信设备硬件工程师应该具备的基本能力和知识-2
查看>>
年轻工程师如何锻炼成高手的
查看>>
Android 源码编译 文件系统制作
查看>>