题目链接:uva 1464 - Traffic Real Time Query System
必须经过的点一定是切点,将图缩点,以块和切点建立一棵树,然后即是在树上查询两节点路径上切点数,求出LCA容斥一下。
#include <cstdio>
#include <cstring>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
typedef pair<int,int> pii;
const int maxn = 10005;
const int maxm = 100005;
int N, M, eccno[maxm];
int cntlock, cntbcc, pre[maxn], iscut[maxn], bccno[maxn];
int E, first[maxn], jump[maxm << 1], link[maxm << 1];
vector<int> G[maxn << 1], BCC[maxn], t