AtCoder Beginner Contest 297
翻译中…
Problem Statement
翻译中…
A positive-integer sequence is said to be splendid if no two adjacent elements are equal.
翻译中…
Find the sum, modulo $998244353$, of the lengths of all splendid sequences whose elements have a sum of $N$.
翻译中…
Constraints
翻译中…
$1 \le N \le 2 \times 10^5$- All values in the input are integers.
翻译中…
Input
翻译中…
The input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Print the answer.
翻译中…
样例
Input #1
4
Output #1
8
There are four splendid sequences whose sum is $4$: $(4),(1,3),(3,1),(1,2,1)$. Thus, the answer is the sum of their lengths: $1+2+2+3=8$.
$(2,2)$ and $(1,1,2)$ also have a sum of $4$ but ineligible because their $1$-st and $2$-nd elements are the same.
Input #2
297
Output #2
475867236
Input #3
123456
Output #3
771773807
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。