The 2022 SDUT Summer Trials |
---|
Finished |
Ginger has a total of $$$n$$$ cows, he has $$$m$$$ old cows and $$$n-m$$$ small cows. Old cows can feed small cows, Ginger wants to pair as many cows with small cows as possible.
Ginger wants to know the maximum number of small cows that can be fed
The first line contains three integers $$$m$$$ indicating the number of old cows, $$$n$$$ indicating the number of cows, $$$q$$$ indicating feeding relationship. $$$1 \le m \le n \le 100$$$, $$$1 \le q \le 10 ^ 3$$$
Next $$$q$$$ lines, each line has two strings $$$u, v$$$, representing old cows $$$u$$$ can feed small cows $$$v$$$
Print the maximum number of small cows that can be fed.
5 10 10 A G A H B F B I B J C G C H D G D H E J
4
Name |
---|