综合性很强的一道图论题,用到了补图,双连通分量,二分图等几个知识点,这里有某位大牛的神解题报告点击打开链接。
题目
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<stack>
using namespace std;
#define N 1005
vector<int> vec[N],lin[N];
stack<int> sta;
int n,step,cnt,ans,low[N],dfn[N],ins[N],col[N];
bool p[N][N];
void tarjan(int now,int pre)
{
low[now]=dfn[now]=step++;
sta.push(now);
ins[now]=1;
int len=......
阅读全文