{"problem":{"name":"[HUSTFC 2023] 近似递增序列","description":{"content":"对于一个长度为 $m\\ (m\\ge 1)$ 的整数序列 $a_1,a_2,\\cdots,a_m\\ (a_i>0)$，如果**最多**只存在一个整数 $p\\ (1\\le p<m)$ 满足 $a_p\\ge a_{p+1}$，则可以称这样的序列为近似递增序列，同时我们定义这个近似递增序列的权值为 $\\prod_{i=1}^m a_i$。 设 $f(i)$ 表示权值为 $i$ 的近似递增序列的数量，du","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":6000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P6"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP9781"},"statements":[{"statement_type":"Markdown","content":"对于一个长度为 $m\\ (m\\ge 1)$ 的整数序列 $a_1,a_2,\\cdots,a_m\\ (a_i>0)$，如果**最多**只存在一个整数 $p\\ (1\\le p<m)$ 满足 $a_p\\ge a_{p+1}$，则可以称这样的序列为近似递增序列，同时我们定义这个近似递增序列的权值为 $\\prod_{i=1}^m a_i$。\n\n设 $f(i)$ 表示权值为 $i$ 的近似递增序列的数量，duoluoluo 想知道 $\\sum_{i=1}^n f(i)$ 的值，但是他连 $f(2)$ 都不会计算，你可以帮帮他吗？由于答案可能会非常大，你只需要求出其对 $998\\,244\\,353$ 取模后的值。\n\n## Input\n\n一行包含一个整数 $n\\ (1\\le n\\le 10^8)$，其含义如题目所述。\n\n## Output\n\n输出一个整数，表示 $\\sum_{i=1}^n f(i)$ 对 $998\\,244\\,353$ 取模后的值。\n\n[samples]\n\n## Note\n\n样例一中 $7$ 个近似递增序列为：$\\{1\\}$，$\\{1,1\\}$，$\\{1,1,2\\}$，$\\{1,2\\}$，$\\{1,2,1\\}$，$\\{2\\}$，$\\{2,1\\}$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGP9781","tags":["2023","O2优化","高校校赛"],"sample_group":[["2","7\n"],["5","26\n"]],"created_at":"2026-03-03 11:09:25"}}