[THUPC 2022 初赛] 最小公倍树

Luogu
IDLGP8207
Time1000ms
Memory512MB
DifficultyP5
2022O2优化图论建模生成树THUPC
对于任意 $V\subset\mathbb{N}^*$,$|V|<+\infty$,构造一张无向完全图 $G=(V,E)$,其中 $(u, v)$ 的边权为 $u,v$ 的最小公倍数 $\mathrm{lcm}(u, v)$。称 $G$ 的最小生成树为 $V$ 的最小公倍树(LCT, Lowest Common Tree)。 现在给出 $L, R$,请你求出 $V={L, L+1, \cdots, R}$ 的最小公倍树 $LCT(V)$。 ## Input 输入仅一行,包括两个正整数 $L, R$。 ## Output 输出一个正整数,表示 $LCT(V)$ 的边权和。 [samples] ## Background 听说有人嫌题面描述都太长了。 ## Note 【样例解释】 其中一种最小公倍树上的边为 $(3, 4), (3, 5), (3, 6), (3, 7), (4, 8), (3, 9), (5, 10), (3, 11), (3, 12)$。 【数据范围】 对于 $100\%$ 的数据,保证 $1\le L\le R\le 10^6$,且 $R-L\le 10^5$。
Samples
Input #1
3 12
Output #1
126
Input #2
6022 14076
Output #2
66140507445
Input #3
13063 77883
Output #3
3692727018161
Input #4
325735 425533
Output #4
1483175252352926
API Response (JSON)
{
  "problem": {
    "name": "[THUPC 2022 初赛] 最小公倍树",
    "description": {
      "content": "对于任意 $V\\subset\\mathbb{N}^*$,$|V|<+\\infty$,构造一张无向完全图 $G=(V,E)$,其中 $(u, v)$ 的边权为 $u,v$ 的最小公倍数 $\\mathrm{lcm}(u, v)$。称 $G$ 的最小生成树为 $V$ 的最小公倍树(LCT, Lowest Common Tree)。 现在给出 $L, R$,请你求出 $V={L, L+1, \\cdots",
      "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": "LGP8207"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "对于任意 $V\\subset\\mathbb{N}^*$,$|V|<+\\infty$,构造一张无向完全图 $G=(V,E)$,其中 $(u, v)$ 的边权为 $u,v$ 的最小公倍数 $\\mathrm{lcm}(u, v)$。称 $G$ 的最小生成树为 $V$ 的最小公倍树(LCT, Lowest Common Tree)。\n\n现在给出 $L, R$,请你求出 $V={L, L+1, \\cdots...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments