poj Popular Cows(tarjan +缩点)

Every cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that tell you that cow A thinks that cow B is popular. Since popularity is transitive, if A thinks B is popular and B thinks C is popular, then A will also think that C ispopular, even if this is not explicitly specified by an ordered pair in the input. Your task is to compute the number of cows that are considered popular by every other cow.

,为了一些琐事吵架,然后冷战,疯狂思念对方,最后和好。

poj Popular Cows(tarjan +缩点)

相关文章:

你感兴趣的文章:

标签云: