首页 > [HAOI2006]受欢迎的牛
头像 黄学骏
发表于 2022-08-16 17:03:15
//标记上时间后: //dfn[u]dfs遍历到u的时间(编号) //low[u]从u开始走所能遍历到的最小时间戳 //得先预处理出dfn和low //当一个强连通的出度为0,则该强连通分量中的所有点都被其他强连通分量的牛欢迎 //但假如存在两及以上个出度=0的牛(强连通分量) //则必然有一头牛 展开全文
头像 minux_sufe
发表于 2020-07-01 19:50:45
#include <bits/stdc++.h> using namespace std; const int N=10005; const int M=50005; int n, m, E=0, scc_cnt=0; int head[N], id[N], sz[N], dout[N 展开全文