3 2 3 1
6 $B$ can be the following six sequences. * $(1,2,1,2,3,2)$ * $(1,2,3,2,1,2)$ * $(2,1,2,1,2,3)$ * $(2,1,2,3,2,1)$ * $(2,3,2,1,2,1)$ * $(3,2,1,2,1,2)$ Thus, the answer is $6$.
1 200000
0 There may be no sequence that satisfies the conditions.
6 12100 31602 41387 41498 31863 12250
750337372
{
"problem": {
"name": "Simple Speed",
"description": {
"content": "You are given a sequence of $N$ positive integers: $A=(A_1,A_2,\\dots,A_N)$. How many integer sequences $B$ consisting of integers between $1$ and $N$ (inclusive) satisfy all of the following condition",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc146_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence of $N$ positive integers: $A=(A_1,A_2,\\dots,A_N)$.\nHow many integer sequences $B$ consisting of integers between $1$ and $N$ (inclusive) satisfy all of the following condition...",
"is_translate": false,
"language": "English"
}
]
}