3 3 2 1
4 We have six candidates for $H$, as follows: * $H = (1, 1, 1)$, for which $P$ is $(-1, -1, -1)$; * $H = (1, 2, 1)$, for which $P$ is $(-1, -1, 2)$; * $H = (2, 1, 1)$, for which $P$ is $(-1, 1, 1)$; * $H = (2, 2, 1)$, for which $P$ is $(-1, -1, 2)$; * $H = (3, 1, 1)$, for which $P$ is $(-1, 1, 1)$; * $H = (3, 2, 1)$, for which $P$ is $(-1, 1, 2)$. Thus, there are four integer sequences that $P$ can be: $(-1, -1, -1), (-1, -1, 2), (-1, 1, 1)$, and $(-1, 1, 2)$.
3 1 1 2
1 We have two candidates for $H$, as follows: * $H = (1, 1, 1)$, for which $P$ is $(-1, -1, -1)$; * $H = (1, 1, 2)$, for which $P$ is $(-1, -1, -1)$. Thus, there is one integer sequence that $P$ can be.
5 2 2 2 2 2
16
13 3 1 4 1 5 9 2 6 5 3 5 8 9
31155
{
"problem": {
"name": "Visibility Sequence",
"description": {
"content": "There are $N$ buildings under construction arranged in a row, numbered $1, 2, \\ldots, N$ from left to right. Given is an integer sequence $X$ of length $N$. The height of Building $i$, $H_i$, can be o",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc104_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There are $N$ buildings under construction arranged in a row, numbered $1, 2, \\ldots, N$ from left to right.\nGiven is an integer sequence $X$ of length $N$. The height of Building $i$, $H_i$, can be o...",
"is_translate": false,
"language": "English"
}
]
}