3 3
14 $14$ sequences satisfy the condition: $(0,0,0),(0,0,1),(0,0,2),(0,1,0),(0,1,1),(0,2,0),(0,2,2),(1,0,0),(1,0,1),(1,1,0),(2,0,0),(2,0,2),(2,2,0)$ and $(2,2,2)$.
8 6
1179
10 1
1024
9 13
18402
314 159
459765451
{
"problem": {
"name": "Banned X",
"description": {
"content": "Find the number, modulo $998244353$, of sequences of length $N$ consisting of $0$, $1$ and $2$ such that none of their contiguous subsequences totals to $X$.",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "tenka1_2019_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Find the number, modulo $998244353$, of sequences of length $N$ consisting of $0$, $1$ and $2$ such that none of their contiguous subsequences totals to $X$.\n\n## Constraints\n\n* $1 \\leq N \\leq 3000$\n...",
"is_translate": false,
"language": "English"
}
]
}