思路:
根据图的性质,一定是在一棵树的基础上有一个环,故边的条数一定等于点的数目。
然后再DFS判断一下是否连通即可。
代码:
#include<cmath>
#include<string>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int A = 100 + 10;
class Gra{
public:
int v,next;
}G[A*A*2];
int head[A],tot,n