#P2419. [USACO08JAN] Cow Contest S
[USACO08JAN] Cow Contest S
Description
cows, conveniently numbered , are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is unique among the competitors.
The contest is conducted in several head-to-head rounds, each between two cows. If cow has a greater skill level than cow , then cow will always beat cow .
Farmer John is trying to rank the cows by skill level. Given a list the results of two-cow rounds, determine the number of cows whose ranks can be precisely determined from the results. It is guaranteed that the results of the rounds will not be contradictory.
5 5
4 3
4 2
3 2
1 2
2 5
2
京公网安备 11011102002149号