5 5 4 1 2 1 3 2 4 3 5 1 5
Yes 3 3 4 5 If we operate according to the sample output, it will go as follows: * Choose edge $3$. Turn on the lamps on vertex $2$ and vertex $4$. * Choose edge $4$. Turn on the lamps on vertex $3$ and vertex $5$. * Choose edge $5$. Turn on the lamp on vertex $1$ and turn off the lamp on vertex $5$. After completing all operations, the lamps on vertices $1$, $2$, $3$, and $4$ are on. Therefore, this sequence of operations satisfies the conditions. Other possible sequences of operations that satisfy the conditions include $X = 4, (e_1,e_2,e_3,e_4) = (3,4,3,1)$. (It is allowed to choose the same edge more than once.)
5 5 5 1 2 1 3 2 4 3 5 1 5
No
10 10 6 2 5 2 6 3 5 3 8 4 6 4 8 5 9 6 7 6 10 7 9
Yes 3 10 9 6
{
"problem": {
"name": "Many Lamps",
"description": {
"content": "There is a simple graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ connects vertices $u_i$ and $v_i$. Each vertex has one lamp on it. Initially, all the lamps ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc345_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a simple graph with $N$ vertices numbered $1$ to $N$ and $M$ edges numbered $1$ to $M$. Edge $i$ connects vertices $u_i$ and $v_i$. \nEach vertex has one lamp on it. Initially, all the lamps ...",
"is_translate": false,
"language": "English"
}
]
}