题意:有一群牛,求被所有牛都认可的牛的个数 每个连通分量建一个缩点,出度为零的缩点包含的点的个数即为要求值 如果有多个出度为零的,直接输出零,否则输出那唯一一个出度为零的缩点包含的点的个数 #include<stdio.h> #include<string.h> #define N 11000 int dfn[N],low[N],sta[N],visit[N],suo[N],ans,outdegree[N],top,num[N]; int head[N],yong,n,m; str…
poj 2186 强连通分量 传送门 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 33414 Accepted: 13612 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…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 37111 Accepted: 15124 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 &…