HDU_2136
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
// hdu 2136
/*
0 1 2 3 4 5 6 7 8 9 10 11
1 0 1 1 1 1 1
1 0 1 2 1 2 1 2 1
1 0 1 2 1 3 2 1 2 3
1 0 1 2 1 3 2 4 1 2 3
1 0 1 2 1 3 2 4 1 2 3
1 0 1 2 1 3 2 4 1 2 3 5 */
const int MAXN=1e6+;
int prime[MAXN]={}, pos=; void get_prime(){
for(int i=; i<MAXN; i++){
if(!prime[i]){
pos++;
for(int j=; i*j<MAXN; j++){
prime[i*j]=pos;
}
}
}
} int main(){
get_prime();
int n;
while(~scanf("%d", &n)){
printf("%d\n", prime[n]);
}
return ;
}
HDU_2136的更多相关文章
- HDU_2136——最大质因数,素数筛选法
Problem Description Everybody knows any number can be combined by the prime number. Now, your task i ...
随机推荐
- 使用AutoMapper时Expression的转换
此文章为转载:http://www.bubuko.com/infodetail-699735.html 参考链接: http://q.cnblogs.com/q/34480/ dudu有回复,其中 ...
- idea git 发起一个pull request 请求
- tf.name_scope()和tf.variable_scope() (转)
网络层中变量存在两个问题: 随着层数的增多,导致变量名的增多: 在调用函数的时候,会重复生成变量,但他们存储的都是一样的变量. tf.variable不能解决这个问题. 变量作用域使用tf.var ...
- 项目IDEA启动配置
在所有java启动项中加入 -Djute.maxbuffer=2048000 tomcat 在catalina.bat 中第一行加入 set JAVA_OPTS=-Djute.maxbuffer=20 ...
- JS-事件对象(鼠标键盘事件)
一 事件对象 1 需要获取键盘和鼠标的信息的时候,用到事件对象.(e) 例如:document.onclick = function(e){ var e = e || event;(做兼容) } ...
- Mono vs IL2CPP
[Mono vs IL2CPP] 参考:http://blog.csdn.net/gz_huangzl/article/details/52486255
- burpsuite的使用(二)
爬网 为了爬网更加顺畅,先关掉截断功能 先进行手动爬网 然后进到目标页面需要点的地方和输入的地方去操作一下,在spider下就能看到爬网的记录 自动爬网 当你爬网时需要登录身份验证时,提示输入,也可以 ...
- JMeter学习(十四)JMeter函数学习(转载)
转载自 http://www.cnblogs.com/yangxia-test JMeter函数是一些能够转化在测试树中取样器或者其他配置元件的域的特殊值.一个函数的调用就像这样:${_functio ...
- JMeter学习(二)录制脚本(转载)
转载自 http://www.cnblogs.com/yangxia-test 环境 Badboy version 2.1.1 JDK: 1.7.0_67 Apache JMeter-2.11 - ...
- android通过命令行安装sdk
在linux下没有界面化的安装sdk方式,所以需要通过下载zip包或命令行安装 一.通过tools下的android安装 1.进入到android工具 cd $ANDROID_HOME/tools ...