论文题目链接:Click here~~
复杂度O(E)。
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int N = 16005;
const int M = 40005;
struct Vertex
{
int head;
}V[N],VV[N];
struct Edge
{
int v,next;
}E[M],EE[M];
int top,topp,scc,id,dfn[N],low[N],ind[N],belong[N],opp[N];
bool in[N],vis[N],color[N];
stack<int> S;
void init()
{
top = topp = 0;
......
阅读全文