传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1827
求联通块入度为0的数量及传递到整个图的最小花费。算是tarjan的模板题了
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<queue>
#include<stack>
using namespace std;
const int N = 1005;
const int inf = 1 << 28;
struct node{
int to, nxt;
}e[N*2];
struct pp{
int st, ed;
}p[N*2];
int head[N], vis[N];
int scc[N], sccnum;
int cnt, index;
int pay[N];
int low[N], dfn[N];
int n, m;......
阅读全文