Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 31241 Accepted: 12691 Description 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 &…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 35644 Accepted: 14532 Description 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 &…
Popular Cows 题意:一只牛崇拜另外一只牛,这种崇拜关系可以传导.A->B,B->C =>A->C.现在给出所有的关系问你有多少牛被其他所有的牛都崇拜. 思路:就是一个tarjan裸模板求出所有的点的low和dfn值,让后通过缩点的方法,确定那些出度为0的点.符合条件的牛肯定就在tarjan求出的所有强连通分量里.缩点后它不会有出度.如果缩点后有多个出度为0的点那么就不存在符合条件的牛了. int n,m,top,c,ti,low[N],Stack[N],vis[N],d…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 23445 Accepted: 9605 Description 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 &l…
http://poj.org/problem?id=2186 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 20191 Accepted: 8193 Description 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…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25945 Accepted: 10612 Description 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 &…
传送门 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 31808 Accepted: 12921 Description 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 <=…