「DTOI-5」#1f1e33

Luogu
IDLGP9308
Time2000ms
Memory512MB
DifficultyP6
O2优化
定义函数 $f(n) = \displaystyle\sum_{i = 1}^n \sum_{j = 1}^n \sum_{k = 1}^n [i + j + k = n] \operatorname{lcm}(i, \gcd(j, k))$ 给定 $n$,对于所有 $1 \leq i \leq n$,**求出所有** $f(i) \bmod 998244353$ 的值。 ## Input 一行,一个整数 $n$。 ## Output 一行,$n$ 个整数,表示所有 $f(i) \bmod 998244353$ 的值。 [samples] ## Background ![](https://cdn.luogu.com.cn/upload/image_hosting/9pyd7oxa.png) In the middle of night. ## Note **【数据范围】** $$ \def\or{\operatorname{or}} %\def\arrayscretch{1.5} \def\arraystretch{1.5} \begin{array}{|c|c|c|}\hline \textbf{测试点编号}&n= &\textbf{Points}\cr\hline \sf1&100&10 \operatorname{pts}\cr\hline \sf2&10^3&10 \operatorname{pts}\cr\hline \sf3&10^4&20 \operatorname{pts}\cr\hline \sf4&10^5&20 \operatorname{pts}\cr\hline \sf5&/&40 \operatorname{pts}\cr\hline \end{array} $$ 对于 $100\%$ 的数据,$1 \leq n \leq 10^6$。
Samples
Input #1
10
Output #1
0 0 1 4 11 20 42 60 100 134
API Response (JSON)
{
  "problem": {
    "name": "「DTOI-5」#1f1e33",
    "description": {
      "content": "定义函数 $f(n) = \\displaystyle\\sum_{i = 1}^n \\sum_{j = 1}^n \\sum_{k = 1}^n [i + j + k = n] \\operatorname{lcm}(i, \\gcd(j, k))$ 给定 $n$,对于所有 $1 \\leq i \\leq n$,**求出所有** $f(i) \\bmod 998244353$ 的值。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P6"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9308"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "定义函数 $f(n) = \\displaystyle\\sum_{i = 1}^n \\sum_{j = 1}^n \\sum_{k = 1}^n [i + j + k = n] \\operatorname{lcm}(i, \\gcd(j, k))$\n\n给定 $n$,对于所有 $1 \\leq i \\leq n$,**求出所有** $f(i) \\bmod 998244353$ 的值。\n\n## Input\n\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments