#P4610. [COI 2012] KAMPANJA
[COI 2012] KAMPANJA
Description
There are cities and directed edges, satisfying .
We need to find, among all routes that start from city , pass through city on the way, and finally return to city , the minimum number of cities that need to be visited. The testdata guarantees that a solution exists.
Input Format
The first line contains two integers . is the number of cities, and is the number of directed edges.
The next lines each contain two integers , indicating a directed edge from to .
Output Format
Output the minimum number of cities that need to be monitored.
6 7
1 3
3 4
4 5
5 1
4 2
2 6
6 3
6
Hint
For of the testdata, holds.
The testdata for this problem is strengthened by Imagine.
Translated by ChatGPT 5
京公网安备 11011102002149号