#P10938. Vani和Cl2捉迷藏
Vani和Cl2捉迷藏
Problem Description
Vani and cl2 are playing hide-and-seek in a forest.
There are houses and directed roads in the forest, forming a directed acyclic graph.
The trees in the forest are very dense and can block the line of sight, but along the roads the view is clear.
If one can walk from house along the roads and reach , then people in and can see each other.
Now cl2 wants to choose of the houses as hiding places, and Vani will only enter the houses that cl2 chose to search. To avoid being seen by Vani, cl2 requires that for any two of these hiding places, there is no path connecting them.
To make it harder for Vani to find him, cl2 wants to know the maximum number of hiding places that can be chosen.
Input Format
The first line of the input contains two integers and .
The next lines each contain two integers , indicating a directed road from to .
Output Format
Output one integer, the maximum number of hiding places that can be chosen.
4 4
1 2
3 2
3 4
4 2
2
Hint
- For of the testdata, , .
- For of the testdata, , .
- For of the testdata, , , .
Translated by ChatGPT 5