[GESP202403 五级] B-smooth 数

Luogu
IDLGB3969
Time1000ms
Memory512MB
DifficultyP2
2024素数判断,质数,筛法GESP
小杨同学想寻找一种名为 $ B $-smooth 数的正整数。 如果一个正整数的最大质因子不超过 $ B $,则该正整数为 $ B $-smooth 数。小杨同学想知道,对于给定的 $ n $ 和 $ B $,有多少个不超过 $ n $ 的 $ B $-smooth 数。 ## Input 第一行包含两个正整数 $ n $ 和 $ B $,含义如题面所示。 ## Output 输出一个非负整数,表示不超过 $ n $ 的 $ B $-smooth 数的数量。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1145> ## Note ### 样例解释 在不超过 $10$ 的正整数中,$3$-smooth 数有 ${1,2,3,4,6,8,9}$,共 $7$ 个。 ### 数据规模与约定 | 子任务 | 得分 | $n \leq $ | $B$ | | :-: | :-: | :-: | :-: | | $1$ | $30$ | $10^3$ | $1 \leq B \leq 10^3$ | | $2$ | $30$ | $10^6$ | $\sqrt n \leq B \leq 10^6$ | | $3$ | $40$ | $10^6$ | $1 \leq B \leq 10^6$ | 对全部的测试数据,保证 $1 \leq n, B \leq 10^6$。
Samples
Input #1
10 3
Output #1
7
API Response (JSON)
{
  "problem": {
    "name": "[GESP202403 五级] B-smooth 数",
    "description": {
      "content": "小杨同学想寻找一种名为 $ B $-smooth 数的正整数。  如果一个正整数的最大质因子不超过 $ B $,则该正整数为 $ B $-smooth 数。小杨同学想知道,对于给定的 $ n $ 和 $ B $,有多少个不超过 $ n $ 的 $ B $-smooth 数。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB3969"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小杨同学想寻找一种名为 $ B $-smooth 数的正整数。 \n\n如果一个正整数的最大质因子不超过 $ B $,则该正整数为 $ B $-smooth 数。小杨同学想知道,对于给定的 $ n $ 和 $ B $,有多少个不超过 $ n $ 的 $ B $-smooth 数。\n\n## Input\n\n第一行包含两个正整数 $ n $ 和 $ B $,含义如题面所示。\n\n## Output\n\n输出一个...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments