poj 2186 Popular Cows
摘要:
http://poj.org/problem?id=2186题意:若A认为B好,且B又认为C好,则可以推出A认为C好,现给一个这样的无向关系图,求出有多少个点,所有人都认为它好。思路:先对图进行tarjan去环缩边成点,并统计环中点的个数,然后查看一下出度为0的点是否为1,如果是则这个点代表的环里的点的数目,否则puts("0");View Code #include<stdio.h>#include<string.h>#include<iostream>#include<stack>#include<utility&g 阅读全文
posted @ 2012-06-27 21:18 aigoruan 阅读(133) 评论(0) 推荐(0)