[信息与未来 2021] 幸运数字

Luogu
IDLGB3756
Time1000ms
Memory128MB
DifficultyP2
2021江苏枚举进制信息与未来
如果一个正整数 $n$ 在五进制、七进制、九进制的表示下都没有数字 $0$,我们就称 $n$ 是幸运数字。例如: - $(987)_{10}=(12422)_5=(2610)_7=(1316)_9$,因此 $n=987$ 不是幸运数字。 - $(988)_{10}=(12423)_5=(2611)_7=(1317)_9$,因此 $n=988$ 是幸运数字。 写程序求出 $a,a+1,a+2,\cdots,b$ 之间一共有多少个幸运数字。 ## Input 输入一行两个正整数 $a$ 和 $b$。 ## Output 输出一行,表示 $a,a+1,a+2,\cdots,b$ 中幸运数字的个数。 [samples] ## Note 对于 $40\%$ 的数据,$1\leq a \leq b \leq 10^3$。 对于 $100\%$ 的数据,$1\leq a \leq b \leq 10^6$。 >本题原始满分为 $15\text{pts}$。
Samples
Input #1
100 1000
Output #1
203
Input #2
900 4096
Output #2
389
API Response (JSON)
{
  "problem": {
    "name": "[信息与未来 2021] 幸运数字",
    "description": {
      "content": "如果一个正整数 $n$ 在五进制、七进制、九进制的表示下都没有数字 $0$,我们就称 $n$ 是幸运数字。例如: - $(987)_{10}=(12422)_5=(2610)_7=(1316)_9$,因此 $n=987$ 不是幸运数字。 - $(988)_{10}=(12423)_5=(2611)_7=(1317)_9$,因此 $n=988$ 是幸运数字。 写程序求出 $a,a+1,a+2,",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB3756"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "如果一个正整数 $n$ 在五进制、七进制、九进制的表示下都没有数字 $0$,我们就称 $n$ 是幸运数字。例如:\n\n- $(987)_{10}=(12422)_5=(2610)_7=(1316)_9$,因此 $n=987$ 不是幸运数字。\n\n- $(988)_{10}=(12423)_5=(2611)_7=(1317)_9$,因此 $n=988$ 是幸运数字。\n\n写程序求出 $a,a+1,a+2,...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments