原题 这是一个强连通分量板子题. a thinks b is popular 即为a到b有一条边,要求被所有牛popular的牛的个数. 所求为对图进行强连通分量缩点后,没有出度的强连通分量里的点数(这样的强连通分量只能有一个). #include<cstdio> #include<algorithm> #include<stack> #define N 10010 #define M 50010 using namespace std; int n,m,head[N]…
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…
id=2186">http://poj.org/problem? id=2186 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 23819 Accepted: 9767 Description Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <=…
题目地址:http://poj.org/problem?id=2186 Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 27496 Accepted: 11059 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…
传送门 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 <=…
Popular Cows Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 29908 Accepted: 12131 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: 31815 Accepted: 12927 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: 30999 Accepted: 12580 Description Every cow's dream is to become the most popular cow in the herd. In a herd of…