Topic Link
Meaning of the questions: give you n points, m edges, find how many sides are not necessarily to go through.
Problem solution: tarjan seeking bridge template question, if this edge is a bridge, it is sure to pass.
Analyzing the bridge condition: low [v]> dfn [u], described so low [v] is not updated, the loop does not exist.
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+100;
struct edge{
int next,v;
}e[maxn*6];
int head[maxn],low[maxn],dfn[maxn];
int cnt,tot,res;
void insert(int u,int v){
e[++tot].next=head[u];e[tot].v=v;head[u]=tot;
e[++tot].next=head[v];e[tot].v=u;head[v]=tot;
}
void tarjan(int u,int fa){
low[u]=dfn[u]=++cnt;
for(int i=head[u];i;i=e[i].next){
int v = e[i].v;
if(v==fa) continue;
if(!dfn[v]) {
tarjan(v,u);
low[u]=min(low[u],low[v]);
if(low[v]>dfn[u]) res++;
}
else low[u] = min(low[u],dfn[v]);
}
}
int main()
{
int n,m,u,v;
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>u>>v;
insert(u,v);
}
tarjan(1,0);
printf("%d\n",m-res);
}