Shirlies
宁静专注认真的程序媛~
摘要: 先用Tarjan求出强连通分量,其他算法也可以的,再缩点,然后从入度为0的点开始暴搜,如果深度达到强连通分量的个数即可行。这一题一定要注意一点:我用cin的时候TLE,该scanf就好了。。。View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <vector> 4 using namespace std; 5 6 const int maxN = 1000 + 10; 7 vector<int> edge[maxN]; 8 int low[maxN]; 9 int stack 阅读全文
posted @ 2012-09-09 21:05 Shirlies 阅读(162) 评论(0) 推荐(0) 编辑