Problem C
Cave Exploration
Alice is a soccer coach who occasionally bring her soccer
team to explore Caveland (that can be modeled as an undirected
unweighted connected graph) for special event, e.g. for
initiation ceremony, to celebrate birthdays, etc. Caveland has
Caveland is quite prone to flooding, but that does not stop
Alice and her soccer team from doing what they enjoy. You are
Bob, Alice’s good friend. You want to ensure Alice and her
soccer team are as safe as possible by letting her know which
junction(s) is/are safe(r) than the rest. You decide that a
junction
![\includegraphics[width=8cm]{caveland.png}](/problems/caveexploration/file/statement/en/img-0001.png)
For this example, junctions
Input
The first line of input consists of
Output
Print an integer in one line: The total number of junction(s) in Caveland that is/are safe(r) for Alice and her soccer team to explore. The actual junction numbers are not needed.
Sample Input 1 | Sample Output 1 |
---|---|
9 10 0 1 0 2 1 3 2 3 2 8 3 4 4 5 4 6 5 7 6 7 |
4 |