5 1 2 3 3 5 2 4 1 4 2 2 4 1 5 1 2 4
4 2 1 * At the time of the first query, only vertex $4$ is reachable from vertex $4$ via some edges on $G$. * At the time of the third query, vertices $2$, $3$, $4$, and $5$ are reachable from vertex $4$ via some edges on $G$. * At the time of the fifth query, vertices $1$, $2$, $3$, $4$, and $5$ are reachable from vertex $4$ via some edges on $G$.
7 1 1 2 2 3 3 10 2 5 1 5 2 2 5 1 2 1 1 7 1 1 6 3 2 5 2 6 2 1 1 7 1
5 2 1 1 1
{
"problem": {
"name": "Minimum Reachable City",
"description": {
"content": "We have a directed graph $G_S$ with $N$ vertices numbered $1$ to $N$. It has $N-1$ edges. The $i$\\-th edge $(1\\leq i \\leq N-1)$ goes from vertex $p_i\\ (1\\leq p_i \\leq i)$ to vertex $i+1$. We have anot",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc295_g"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have a directed graph $G_S$ with $N$ vertices numbered $1$ to $N$. It has $N-1$ edges. The $i$\\-th edge $(1\\leq i \\leq N-1)$ goes from vertex $p_i\\ (1\\leq p_i \\leq i)$ to vertex $i+1$.\nWe have anot...",
"is_translate": false,
"language": "English"
}
]
}