Dudu's maze
23.7% 1000ms 262144K To seek candies for Maomao, Dudu comes to a maze. There are n n rooms numbered from 1 1 to n n and m m undirected roads. There are two kinds of rooms in the maze -- candy room and monster room. There is one candy in each candy room, and candy room is safe. Dudu can take the only candy away when entering the room. After he took the candy, this candy room will be empty. A empty room is also safe. If Dudu is in safe, he can choose any one of adjacent rooms to go, whatever it is. Two rooms are adjacent means that at least one road connects the two rooms. In another kind of