3 -1 -1 -1
7 The replacements that satisfy the condition are the following seven: * $(1,1,2)$ * $(2,1,2)$ * $(2,2,2)$ * $(2,3,1)$ * $(2,3,2)$ * $(2,3,3)$ * $(3,1,2)$ For example, in the case of $A=(1,1,2)$, that the interval $[1,2]$ satisfies the condition can be confirmed by setting $x=1$, where vertices $2$ and $A_2=1$ are connected and vertices $1,2$ form a tree. Similarly, intervals $[1,1],[2,2],[3,3],[2,3],[1,3]$ also satisfy the condition, so $(1,1,2)$ is a good sequence.
3 -1 3 -1
3 The replacements that satisfy the condition are the following three: * $(2,3,1)$ * $(2,3,2)$ * $(2,3,3)$
6 2 3 -1 -1 -1 -1
21
{
"problem": {
"name": "Tree Sequence",
"description": {
"content": "A sequence $B=(B_1,\\ldots,B_N)$ of length $N$ consisting of integers between $1$ and $N$ (inclusive) is called a good sequence if and only if it satisfies the following condition: * For every inter",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc206_c"
},
"statements": [
{
"statement_type": "Markdown",
"content": "A sequence $B=(B_1,\\ldots,B_N)$ of length $N$ consisting of integers between $1$ and $N$ (inclusive) is called a good sequence if and only if it satisfies the following condition:\n\n* For every inter...",
"is_translate": false,
"language": "English"
}
]
}