[DTCPC 2024] 取模

Luogu
IDLGP10171
Time1000ms
Memory512MB
DifficultyP5
2024数论快速傅里叶变换 FFT洛谷月赛
给定序列 $\{a_n\}$ 和 $[L,R]$,问有多少个 $k\in [L,R]$ 满足 $a_i\bmod k$ 互不相同。 ## Input 第一行三个正整数 $n,L,R$($n\leq 5\times 10^4,1\leq L\leq R\leq 10^9$)。 第二行 $n$ 个正整数,表示 $\{a_n\}$($0 < a_i\leq 4\times10^5$)。 ## Output 一行一个数,表示答案。 [samples]
Samples
Input #1
3 1 3
11 7 6
Output #1
1
API Response (JSON)
{
  "problem": {
    "name": "[DTCPC 2024] 取模",
    "description": {
      "content": "给定序列 $\\{a_n\\}$ 和 $[L,R]$,问有多少个 $k\\in [L,R]$ 满足 $a_i\\bmod k$ 互不相同。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P5"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10171"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定序列 $\\{a_n\\}$ 和 $[L,R]$,问有多少个 $k\\in [L,R]$ 满足 $a_i\\bmod k$ 互不相同。\n\n## Input\n\n第一行三个正整数 $n,L,R$($n\\leq 5\\times 10^4,1\\leq L\\leq R\\leq 10^9$)。\n\n第二行 $n$ 个正整数,表示 $\\{a_n\\}$($0 < a_i\\leq 4\\times10^5$)。\n\n## O...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments