3
132 For instance, $A = (1, 3, 3, 2, 2, 2, 1, 1, 3)$ satisfies the condition in the problem statement. On the other hand, $A = (1, 3, 3, 2, 2, 3, 1, 1, 2)$ does not, because the $5$\-th, $6$\-th, $7$\-th elements of $A$ form a contiguous subsequence that is a permutation of the sequence $(1, 2, 3)$.
123456
31984851
{
"problem": {
"name": "No Permutations",
"description": {
"content": "You are given a positive integer $N$. Print the number, modulo $998244353$, of sequences $A$ of length $3N$ that contain each integer from $1$ through $N$ three times and satisfy the following conditi",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 8000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc064_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a positive integer $N$. Print the number, modulo $998244353$, of sequences $A$ of length $3N$ that contain each integer from $1$ through $N$ three times and satisfy the following conditi...",
"is_translate": false,
"language": "English"
}
]
}