#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的更多相关文章

  1. HDU_2136——最大质因数,素数筛选法

    Problem Description Everybody knows any number can be combined by the prime number. Now, your task i ...

随机推荐

  1. 使用AutoMapper时Expression的转换

    此文章为转载:http://www.bubuko.com/infodetail-699735.html 参考链接: http://q.cnblogs.com/q/34480/   dudu有回复,其中 ...

  2. Error logged from Ant UI:

    2down vote Have a look at the Eclipse error log. I recently saw following error there: Error logged ...

  3. 导出pdf

    document.getElementById("exportSiteInfoTemp").onclick = function() { var thisMinheight=$(& ...

  4. ssh架构之hibernate(三)关系映射

    1.单向多对一 1.映射文件配置 2.model: 测试 1.查询测试 执行顺序,先查询多方,在查询一方,一方采用延迟加载 注意:如果不使用一方的数据,就关闭session,报错,同延迟加载中的报错类 ...

  5. Choosing the Type at Runtime

    [Choosing the Type at Runtime] You cannot use a general expression as the React element type. If you ...

  6. spring boot 启动错误:Could not resolve placeholder

    在启动整个spring boot项目时,出现错误: Could not resolve placeholder 原因:没有指定好配置文件,因为src/main/resources下有多个配置文件,例如 ...

  7. Vue.Draggable:基于 Sortable.js 的 Vue 拖拽组件使用中遇到的问题

    Sortable.js 介绍 https://segmentfault.com/a/1190000008209715 项目中遇到的问题: A - 我需要在项目的拖拽组件中,使用背景 1 - 想到的第一 ...

  8. 【转】关于easyui的窗口和tab页面不执行js说明

    原地址:http://www.jeasyuicn.com/post-49.html 一直以来群里里面很多人反应,在用tab加载界面的时候,界面里面的js不会执行.今天GodSon在此说明一下原因. 不 ...

  9. 关于json.stringify的注意事项

    今天通过navigator.getCurrentPosition中的success回调,用json.stringify打印postion时,怎么打印都只是一个{}, 而打印postion.coords ...

  10. SAP ALV 修改数字需要添零问题

    问题描述: 修改左列数字,如果想要输入3,那么要输3000,敲空格,才会在ALV里显示为3. 原因: 变量ERFMG引用的域类型小数点位置为3位,当输入数字1时,默认往前数3位,作为小数点位置,变成0 ...