criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
#defineA rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define REP(i,n) rep(i,0,n)
#define ll long long
#define ull unsigned long 

bool dfs(vector<vector<ll> >& g,ll v,vector<bool> check) 
{
  check[v]=true;
  for(auto next:g[v])
     if(!(check[next]))
  	   dfs(g,next,check);
	 
  for(auto i:check)
    if(!i)
    {
      return true;
    }
    return false;
}

int main()
{ 
  ll n,m;
  cin >> n >> m;
  ll A[55][2];
  REP(i,m)
  	cin >> A[i][0] >> A[i][1];
  ll ans=0;
 REP(i,m)
 {
   //構築
 vector<vector<ll> >  Ginf(n);
 REP(j,m)
   if(j != i)
 {
   ll a,b;
   a = A[j][0];
   b = A[j][1];
   a--;
   b--;
   Ginf[a].push_back(b);
   Ginf[b].push_back(a);
 }
   
   vector<bool> check(n,false);
   if(dfs(Ginf,0,check)) ans++;
    
 }
  cout << ans << endl;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #defineA; did you mean #define?
    3 | #defineA rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
      |  ^~~~~~~
      |  define
a.cc: In function 'int main()':
a.cc:28:7: error: 'i' was not declared in this scope
   28 |   REP(i,m)
      |       ^
a.cc:4:22: note: in definition of macro 'REP'
    4 | #define REP(i,n) rep(i,0,n)
      |                      ^
a.cc:4:18: error: 'rep' was not declared in this scope
    4 | #define REP(i,n) rep(i,0,n)
      |                  ^~~
a.cc:28:3: note: in expansion of macro 'REP'
   28 |   REP(i,m)
      |   ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;

// 46786 - 106

vector<vector<int>> ed(56);
vector<int> tin(56, -1);
vector<int> tup(56, -1);
int tm = 0;
int b = 0;

void dfs(int node, int p = -1) {
    tin[node] = tm;
    tup[node] = tm;
    ++tm;
    for (auto out : ed[node]) {
        if (out == p) {
            continue;
        }
        if (tin[out] != -1) {
            tup[node] = min(tup[node], tin[out]);
        } else {
            dfs(out, node);
            tup[node] = min(tup[node], tup[out]);
            if (tup[out] > tin[node]) {
                ++b;
            }
        }
    }
}


void oneCase() {
   int n, m;
   cin >> n >> m;
   for (int i = 0; i < m; ++i) {
       int a, b;
       cin >> a >> b;
       --a;
       --b;
       ed[a].pb(b);
       ed[b].pb(a);
   }
   dfs(0);
   cout << b << "\n";


}


int main() {
    int t = 1;
//    cin >> t;
    while (t--) {
       oneCase();
    }

    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:20:17: error: reference to 'tm' is ambiguous
   20 |     tin[node] = tm;
      |                 ^~
In file included from /usr/include/time.h:39,
                 from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:16:5: note:                 'int tm'
   16 | int tm = 0;
      |     ^~
a.cc:21:17: error: reference to 'tm' is ambiguous
   21 |     tup[node] = tm;
      |                 ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:16:5: note:                 'int tm'
   16 | int tm = 0;
      |     ^~
a.cc:22:7: error: reference to 'tm' is ambiguous
   22 |     ++tm;
      |       ^~
/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h:7:8: note: candidates are: 'struct tm'
    7 | struct tm
      |        ^~
a.cc:16:5: note:                 'int tm'
   16 | int tm = 0;
      |     ^~
Language: C++


#include<iostream>

#include<cstdio>

#include<vector>

#include<stack> 

#include<cstring>

#include<algorithm>

using namespace std;
const int maxn = 10000 + 10;
typedef pair<int, int> Edge;
int index = 0, rootson = 0;
int ans = 0;
vector<bool> vis(maxn);
vector<int> dfn(maxn), low(maxn), cutvex;
vector<vector<int> > G(maxn);
vector<Edge> bridge;
void Tarjan(int u, int father)

{
	dfn[u] = low[u] = ++index;
	vis[u] = true;
	bool isCut = false;
	for (int i = 0; i < G[u].size(); i++)
	{
		int v = G[u][i];
		if (!vis[v]) {
			Tarjan(v, u);
		low[u] = min(low[u], low[v]);
			if (dfn[u] < low[v]) ans++;
			if (dfn[u] <= low[v]) isCut = true;
		}
		else if (father != v) 

			low[u] = min(low[u], dfn[v]);

	}

	if (father == 1 && rootson != -1) rootson++;
	if (rootson > 1) cutvex.push_back(1), rootson = -1;
	if (u != 1 && isCut)	cutvex.push_back(u);
}

int main()

{
	int n, m;
	cin >> n >> m;
	while (m--) {
		int u, v;
		cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
	}

	Tarjan(1, 0);  

	cout << ans << endl;

	return 0;

}


Compiler output:
a.cc:17:5: error: 'int index' redeclared as different kind of entity
   17 | int index = 0, rootson = 0;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:10:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'void Tarjan(int, int)':
a.cc:26:29: error: no pre-increment operator for type
   26 |         dfn[u] = low[u] = ++index;
      |                             ^~~~~
Language: C++

nclude <bits/stdc++.h>
using namespace std;

struct UnionFind{
  vector<int> par;
  UnionFind(int N) : par(N){
    for(int i = 0; i < N; i++){
      par[i] = i;
    }
  }
  int root(int x){
    if(par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y){
    int rx = root(x), ry = root(y);
    if(rx == ry) return;
    par[rx] = ry;
  }
  bool same(int x, int y){
    return root(x) == root(y);
  }
};

int main(){
  int N, M; cin >> N >> M;
  UnionFind tree(N);
  vector<int> a(M), b(M);
  for(int i = 0; i < M; i++){
    cin >> a[i] >> b[i];
    --a[i]; --b[i];
  }
  
  int ans = 0;
  for(int i = 0; i < M; i++){
    UnionFind tree(N);
    for(int j = 0; j < M; j++){
      if(j != i) tree.unite(a[j], b[j]);
    }
    if(!tree.same(a[i], b[i])){
      ++ans;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <bits/stdc++.h>
      | ^~~~~~
a.cc:5:3: error: 'vector' does not name a type
    5 |   vector<int> par;
      |   ^~~~~~
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:6:22: error: class 'UnionFind' does not have any field named 'par'
    6 |   UnionFind(int N) : par(N){
      |                      ^~~
a.cc:8:7: error: 'par' was not declared in this scope
    8 |       par[i] = i;
      |       ^~~
a.cc: In member function 'int UnionFind::root(int)':
a.cc:12:8: error: 'par' was not declared in this scope
   12 |     if(par[x] == x) return x;
      |        ^~~
a.cc:13:12: error: 'par' was not declared in this scope
   13 |     return par[x] = root(par[x]);
      |            ^~~
a.cc: In member function 'void UnionFind::unite(int, int)':
a.cc:18:5: error: 'par' was not declared in this scope
   18 |     par[rx] = ry;
      |     ^~~
a.cc: In function 'int main()':
a.cc:26:13: error: 'cin' was not declared in this scope
   26 |   int N, M; cin >> N >> M;
      |             ^~~
a.cc:28:3: error: 'vector' was not declared in this scope
   28 |   vector<int> a(M), b(M);
      |   ^~~~~~
a.cc:28:10: error: expected primary-expression before 'int'
   28 |   vector<int> a(M), b(M);
      |          ^~~
a.cc:30:12: error: 'a' was not declared in this scope
   30 |     cin >> a[i] >> b[i];
      |            ^
a.cc:30:20: error: 'b' was not declared in this scope
   30 |     cin >> a[i] >> b[i];
      |                    ^
a.cc:38:29: error: 'a' was not declared in this scope
   38 |       if(j != i) tree.unite(a[j], b[j]);
      |                             ^
a.cc:38:35: error: 'b' was not declared in this scope
   38 |       if(j != i) tree.unite(a[j], b[j]);
      |                                   ^
a.cc:40:19: error: 'a' was not declared in this scope
   40 |     if(!tree.same(a[i], b[i])){
      |                   ^
a.cc:40:25: error: 'b' was not declared in this scope
   40 |     if(!tree.same(a[i], b[i])){
      |                         ^
a.cc:44:3: error: 'cout' was not declared in this scope
   44 |   cout << ans << endl;
      |   ^~~~
a.cc:44:18: error: 'endl' was not declared in this scope
   44 |   cout << ans << endl;
      |                  ^~~~
Language: C++

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
    
        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N,M = map(int,input().split())
L = [[] for i in range(M)]
for i in range(M):
  L[i]=list(map(int,input().split()))

def chk(LL):
  uf = UnionFind(N)
  for l in LL:
    uf.union(l[0]-1, l[1]-1)
  return uf.group_count()

ret = 0
for i in range(M):
  LL = L[:]
  LL.pop(i)
  if chk(LL)>1:
    ret+=1
print(ret)

Compiler output:
a.cc:44:26: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   44 |         return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      |                          ^~~~~~~~
a.cc:1:17: error: expected unqualified-id before ')' token
    1 | class UnionFind():
      |                 ^
a.cc:43:5: error: 'def' does not name a type
   43 |     def __str__(self):
      |     ^~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
template<typename T>
struct UnionFind
{
	vector<T> par;
	vector<T> rank;
	UnionFind(T n):par(n),rank(n,0){
	   for(T i=0;i<n;i++){
	     par[i]=i;
	   }
	}
	T root(T x){
	  return par[x]==x?x:par[x]=root(par[x]);
	}

	bool unite(T x,T y){
	  if(x==y) return false;
	  x=root(x); y=root(y);
	  if(x==y) return false;
	  if(rank[x]<rank[y]) swap(x,y);
	  if(rank[x]==rank[y]) rank[x]++;
	  par[y]=x;
	  return true;
	}
	bool same(T x,T y){
	  return root(x)==root(y);
	}
};
int main(){
  ll n,m;
  cin>>n>>m;
  vll a(m),b(m);
  rep(i,m) cin>>a[i]>>b[i];
  ll cu=0;
  rep(i,m){
    UnionFind<ll> uf(n+1);
    rep(j,m){
      if(i==j) continue;
      uf.unite(a[j],b[j]);
    }
    set<ll> ans;
    for(int i=1;i<=n;i++){
      ans.insert(root(i));
    }
    if(sz(ans)>1) cu++;
  }
  COUT(cu);
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:81:18: error: 'root' was not declared in this scope
   81 |       ans.insert(root(i));
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std; 
const int Max=50;
void dfs(int v){
  visited[v]=true;
  for(int v2=0;v2<N;v2++){
    if(G[v][v2]==false)continue;
    if(visited[v2]==true)continue;
    dfs(v2);
  }
}
int main(){
  int N,M,ans=0;
  cin>>N>>M;
  bool G[Max][Max]
  bool visited[Max];
  int a[Max],b[Max];
  
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      G[i][j]=false;
    }
  }
  
  for(int i=0;i<M;i++){
    cin>>a[i]>>b[i];
    a[i]--;
    b[i]--;
    G[a[i]][b[i]]=G[b[i]][a[i]]=true;
  }
  
  for(int i=0;i<M;i++){
    G[a[i]][b[i]]=G[b[i]][a[i]]=false;
    
    for(int j=0;j<N;j++) visited[j]=false;
    
    dfs(0);
    
    bool bridge=false;
    for(int j=0;j<N;j++) if(visited[j]==false)bridge=true;
    if(bridge)ans++;
    
    G[a[i]][b[i]]=G[b[i]][a[i]]=true;
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:5:3: error: 'visited' was not declared in this scope
    5 |   visited[v]=true;
      |   ^~~~~~~
a.cc:6:19: error: 'N' was not declared in this scope
    6 |   for(int v2=0;v2<N;v2++){
      |                   ^
a.cc:7:8: error: 'G' was not declared in this scope
    7 |     if(G[v][v2]==false)continue;
      |        ^
a.cc: In function 'int main()':
a.cc:16:3: error: expected initializer before 'bool'
   16 |   bool visited[Max];
      |   ^~~~
a.cc:21:7: error: 'G' was not declared in this scope
   21 |       G[i][j]=false;
      |       ^
a.cc:29:5: error: 'G' was not declared in this scope
   29 |     G[a[i]][b[i]]=G[b[i]][a[i]]=true;
      |     ^
a.cc:33:5: error: 'G' was not declared in this scope
   33 |     G[a[i]][b[i]]=G[b[i]][a[i]]=false;
      |     ^
a.cc:35:26: error: 'visited' was not declared in this scope
   35 |     for(int j=0;j<N;j++) visited[j]=false;
      |                          ^~~~~~~
a.cc:40:29: error: 'visited' was not declared in this scope
   40 |     for(int j=0;j<N;j++) if(visited[j]==false)bridge=true;
      |                             ^~~~~~~
Language: C++

#include<cstdio>
#include<queue>
#include<cstring>
using namespace std;
int n,m;
bool edge[258000][258000];
int f[258000], t[258000];
bool vis[258000];
int ans;
int main() {
	scanf("%d%d", &n,&m);
	for (int i = 1; i <= m; i++) {
		scanf("%d%d", &f[i], &t[i]);
		edge[f[i]][t[i]] = edge[t[i]][f[i]] = 1;
	}
	for (int i = 1; i <= m; i++) {
		edge[f[i]][t[i]] = edge[t[i]][f[i]] = 0;
		queue<int>q;
		q.push(1);
		memset(vis, 0, sizeof(vis));
		int s = 1;
		while (!q.empty()) {
			int t = q.front();
			q.pop();
			vis[t] = 1;
			for (int i = 1; i <= n; i++) {
				if (edge[t][i] == 1 && vis[i] == 0) {
					s++;
					q.push(i);
				}
			}
		}
		if (s != n) ans++;
		edge[f[i]][t[i]] = edge[t[i]][f[i]] = 1;
	}
	printf("%d", ans);
}

Compiler output:
/tmp/ccdBz5dW.o: in function `main':
a.cc:(.text+0x4d): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x64): relocation truncated to fit: R_X86_64_PC32 against symbol `f' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x92): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0xaa): relocation truncated to fit: R_X86_64_PC32 against symbol `f' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0xdf): relocation truncated to fit: R_X86_64_PC32 against symbol `f' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x165): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x17d): relocation truncated to fit: R_X86_64_PC32 against symbol `f' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `f' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x1ca): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccdBz5dW.o
a.cc:(.text+0x23c): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <string>
#include <sstream>  // istringstream
#include <vector>

using namespace std;

class Line {
public:
	Line()
		: a_(0)
		, b_(0)
		, inspected_(false)
	{};
	Line(int a, int b)
		: a_(a)
		, b_(b)
		, inspected_(false)
	{};

public:
	int a_;
	int b_;
	bool inspected_;
};


void SeekConnected(int node, std::vector<Line>& vctLine, std::vector<bool>& vctNode)
{
	vctNode[node] = true;
	for (auto& elem : vctLine){
		if (elem.inspected_){
			continue;
		}
		if (elem.a_ == node){
			elem.inspected_ = true;
			SeekConnected(elem.b_, vctLine, vctNode);
		}
		else if (elem.b_ == node){
			elem.inspected_ = true;
			SeekConnected(elem.a_, vctLine, vctNode);
		}
	}
}
bool IsBridge(int index, const std::vector<Line>& vctLine, std::vector<bool>& vctNode)
{
	std::vector<Line> tmpVctLine(vctLine);
	tmpVctLine.erase(tmpVctLine.begin() + index);
	vctNode.assign(vctNode.size(), false);

	SeekConnected(tmpVctLine[0].a_, tmpVctLine, vctNode);
	SeekConnected(tmpVctLine[0].b_, tmpVctLine, vctNode);

	for (auto& elem : vctNode){
		if (elem == false){
			return true;;
		}
	}
	return false;
}

int main()
{
	int N = 0, M = 0;
	//std::string lineBuf;

	cin >> N >> M;

	std::vector<Line> vctLine(M);
	std::vector<bool> vctNode(N, false);

	for (auto& elem : vctLine){
		int a = 0, b = 0;
		cin >> a >> b;
		elem = Line(a - 1, b - 1);
	}

	int count = 0;
	for (int i = 0; i < M; ++i){
		if (IsBridge(i, vctLine, vctNode)){
			++count;
		}
	}

	cout << count;

	return 0;
}

Compiler output:
a.cc: In function 'bool IsBridge(int, const std::vector<Line>&, std::vector<bool>&)':
a.cc:54:27: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference'
   54 |         for (auto& elem : vctNode){
      |                           ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int indexx=0,child=0;
int num[55],low[55],ans=0;
struct node
{
	int nxt,to;
}e[5005];
int head[5005],cnt=0;
void add(int u,int v)
{
	e[++cnt].to=v;
	e[cnt].nxt=head[u];
	head[u]=cnt;
}
inline int read()
{
	int x=0,w=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-') w=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		x=(x<<1)+(x<<3)+c^'0';
		c=getchar();
	}
	return w*x;
}
void dfs(int cur,int fa)
{
	child=0;
	indexx++;
	low[cur]=num[cur]=indexx;
	for(int i=head[cur];i;i=e[i].nxt)
	{
		int j=e[i].to;
		if(!num[j])
		{
			dfs(j,cur);
			low[cur]=min(low[cur],low[j]);
			if(low[j]>num[cur]) ans++;
		}
		else if(j!=fa) low[cur]=min(low[cur],num[j]);
	}
	return;
}
int n,m,l,r;
int main()
{	
	while(n=read(),m=read())
	{
		ans=0;
		index=0;
		memset(low,0,sizeof(low));
		memset(num,0,sizeof(num));
		memset(e,0,sizeof(e));
		memset(head,0,sizeof(head));
		for(int i=1;i<=m;i++)
		{
			l=read(),r=read();
			add(l,r),add(r,l);	
		}
		dfs(1,-1);
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:23: error: overloaded function with no contextual type information
   59 |                 index=0;
      |                       ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MAX_N 50
using namespace std;

int n,m;
int a[MAX_N], b[MAX_N];
bool G[MAX_N][MAX_N];
bool visited[MAX_N];

bool dfs(int u){
    visited[u] = true;
    
    for(int v =0; v<n; v++){
        if(G[u][v] == false ) continue;
            if( visited[v] )continue;
            dfs(v);
    }
}

int main(){
    cin>>n>>m;
    fill(G, G +250, false);
    for(int i = 0; i< n;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]][b[i]] = true;
    }
    int ans =0;

    for(int i = 0; i <m; i++){
        fill(visited,visited + n,false);
        G[a[i]][b[i]] = G[b[i]][a[i]] == false;

        dfs(0);

        bool must_b = false;
        for(int j=0; j<n; j++){
            if(visited[j] == false) must_b == true;
            break;
        }
        if(must_b) ans++;
        G[a[i]][b[i]] = G[b[i]][a[i]] == true;
    }
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'bool dfs(int)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[50]; _Tp = bool; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = bool (*)[50]; _Tp = bool]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[50]; _Tp = bool]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:23:9:   required from here
   23 |     fill(G, G +250, false);
      |     ~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:18: error: incompatible types in assignment of 'const bool' to 'bool [50]'
  952 |         *__first = __tmp;
      |         ~~~~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MAX_N 50
using namespace std;

int n,m;
int a[MAX_N], b[MAX_N];
bool G[MAX_N][MAX_N];
bool visited[MAX_N];

bool dfs(int u){
    visited[u] = true;
    
    for(int v =0; v<n; v++){
        if(G[u][v] == false ) continue;
            if( visited[v] )continue;
            dfs(v);
    }
}

int main(){
    cin>>n>>m;
    fill(G, G + MAX_N*MAX_N, false);
    for(int i = 0; i< n;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]][b[i]] = true;
    }
    int ans =0;

    for(int i = 0; i <m; i++){
        fill(visited,visited + n,false);
        G[a[i]][b[i]] = G[b[i]][a[i]] == false;

        dfs(0);

        bool must_b = false;
        for(int j=0; j<n; j++){
            if(visited[j] == false) must_b == true;
            break;
        }
        if(must_b) ans++;
        G[a[i]][b[i]] = G[b[i]][a[i]] == true;
    }
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'bool dfs(int)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[50]; _Tp = bool; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = bool (*)[50]; _Tp = bool]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[50]; _Tp = bool]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:23:9:   required from here
   23 |     fill(G, G + MAX_N*MAX_N, false);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:18: error: incompatible types in assignment of 'const bool' to 'bool [50]'
  952 |         *__first = __tmp;
      |         ~~~~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MAX_N 50
using namespace std;

int n,m;
int a[MAX_N], b[MAX_N];
bool G[MAX_N][MAX_N];
bool visited[MAX_N];

bool dfs(int u){
    visited[u] = true;
    
    for(int v =0; v<n; v++){
        if(G[u][v] == false ) continue;
            if( visited[v] )continue;
            dfs(v);
    }
}

int main(){
    cin>>n>>m;
    fill(G, G + N_MAX*N_MAX, false);
    for(int i = 0; i< n;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]][b[i]] = true;
    }
    int ans =0;

    for(int i = 0; i <m; i++){
        fill(visited,visited + n,false);
        G[a[i]][b[i]] = G[b[i]][a[i]] == false;

        dfs(0);

        bool must_b = false;
        for(int j=0; j<n; j++){
            if(visited[j] == false) must_b == true;
            break;
        }
        if(must_b) ans++;
        G[a[i]][b[i]] = G[b[i]][a[i]] == true;
    }
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'bool dfs(int)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
a.cc: In function 'int main()':
a.cc:23:17: error: 'N_MAX' was not declared in this scope; did you mean 'NL_NMAX'?
   23 |     fill(G, G + N_MAX*N_MAX, false);
      |                 ^~~~~
      |                 NL_NMAX
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MAX_N 50
using namespace std;

int n,m;
int a[MAX_N], b[MAX_N];
bool G[MAX_N][MAX_N];
bool visited[MAX_N];

bool dfs(int u){
    visited[u] = true;
    
    for(int v =0; v<n; j++){
        if(G[u][v] == false ) continue;
            if( visited[v] )continue;
            dfs(v);
    }
}

int main(){
    cin>>n>>m;
    for(int i = 0; i< n;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]][b[i]] = true;
    }
    int ans =0;

    for(int i = 0; i <m; i++){
        fill(visited,visited + n,false);
        G[a[i]][b[i]] = G[b[i]][a[i]] == false;

        dfs(0);

        bool must_b = false;
        for(int j=0; j<n; j++){
            if(visited[i] == false) must_b == true;
            break;
        }
        if(must_b) ans++;
    }
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'bool dfs(int)':
a.cc:14:24: error: 'j' was not declared in this scope
   14 |     for(int v =0; v<n; j++){
      |                        ^
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MAX_N 50
using namespace std;

int n,m;
int a[MAX_N], b[MAX_N];
bool G[MAX_N][MAX_N];
bool visited[MAX_N];

bool dfs(int u){
    visited[u] = true;
    
    for(int v =0; j<n; j++){
        if(G[u][v] == false ) continue;
            if( visited[v] )continue;
            dfs(v);
    }
}

int main(){
    cin>>n>>m;
    for(int i = 0; i< n;i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]][b[i]] = true;
    }
    int ans =0;

    for(int i = 0; i <m; i++){
        fill(visited,visited + n,false);
        G[a[i]][b[i]] = G[b[i]][a[i]] == false;

        dfs(0);

        bool must_b = false;
        for(int j=0; j<n; j++){
            if(visited[i] == false) must_b == true;
            break;
        }
        if(must_b) ans++;
    }
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'bool dfs(int)':
a.cc:14:19: error: 'j' was not declared in this scope
   14 |     for(int v =0; j<n; j++){
      |                   ^
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n,m,ans;
int total=0;
int index=0;
int head[100010];
int num[100010],low[100010];
struct edge
{
    int from;
    int to;
    int next;
}input[100010];
void add_edge(int a,int b)
{
    total++;
    input[total].from=a;
    input[total].to=b;
    input[total].next=head[a];
    head[a]=total;
}
void dfs(int now,int father)
{
    index++;
    num[now]=index;
    low[now]=index;
    for(int e=head[now];e!=0;e=input[e].next)
    {
        if(num[input[e].to]==0)
        {
            dfs(input[e].to,now);
            low[now]=min(low[now],low[input[e].to]);
            if(low[input[e].to]>num[now])++ans;
                
        }
        else if(input[e].to!=father)
            low[now]=min(low[now],num[input[e].to]);
    }
}
int main()
{
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        cin>>a>>b;
        add_edge(a,b); 
        add_edge(b,a);
    }
	for(int i=1;i<=n;++i)if(!num[i])dfs(i,i);
	if(ans)cout<<ans;
}

Compiler output:
a.cc:5:5: error: 'int index' redeclared as different kind of entity
    5 | int index=0;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'void dfs(int, int)':
a.cc:24:10: error: no post-increment operator for type
   24 |     index++;
      |          ^~
a.cc:25:14: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
   25 |     num[now]=index;
      |              ^~~~~
a.cc:26:14: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
   26 |     low[now]=index;
      |              ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(ll i=0;i<(n);i++)

ll n,m;
vector<ll> a(50),b(50);
bool reached[50];

void dfs(ll v){
  reached[v]=true;
  rep(i,n){
    if(graph[v][i]==false) continue;
    if(reached[i]==true) continue;
    dfs(i);
  }
}

int main(){
  
  cin>>n>>m;
  
  rep(i,m){
    cin>>a[i]>>b[i];
    a[i]--;b[i]--;
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
  }
  ll ans=0;
  rep(i,m){
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
    rep(j,n) reached[j]=false;
    dfs(0);
    bool bridge=false;
    rep(j,n) if(!(reached[j])) bridge=true;
    if(bridge) ans++;
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
    
  }
  
  
  
  
  
}

Compiler output:
a.cc: In function 'void dfs(ll)':
a.cc:13:8: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   13 |     if(graph[v][i]==false) continue;
      |        ^~~~~
      |        isgraph
a.cc: In function 'int main()':
a.cc:26:5: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   26 |     graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
      |     ^~~~~
      |     isgraph
a.cc:30:5: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   30 |     graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
      |     ^~~~~
      |     isgraph
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;

bool graph[50][50];
bool visited[50];

void dfs(int v){
   visited[v]=true;
   for(int v2=0;v2<n;++v2){
      if(graph[v][v2]==false) continue;
      if(visited[v2]==true) continue;
      dfs(v2);
   }
}

int main(){
   int n,m;cin>>n>>m;
   vector<int> a(n),b(n);
   rep(i,m){
      cin>>a[i]>>b[i];
      a[i]--; b[i]--;
      graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
   }

int ans=0;
for(int i=0;i<m;++i){
   graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
   rep(j,n) visited[j]=false;
   dfs(0);
   bool bridge = false;
   rep(j,n) if(visited[j]==false)bridge=true;
   if(bridge) ans+=1;

    graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
}
cout<<ans<<endl;

}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:11:20: error: 'n' was not declared in this scope
   11 |    for(int v2=0;v2<n;++v2){
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

bool g[50][50];

bool visited[50];

int dfs(int v) {
  visited[v] = 1;

  for (int c = 0; c < g[v].size(); c++) {
    if (!g[v][c]) continue;
    if (visited[c]) continue;
    dfs(c);
  }
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  int n, m;
  cin >> n >> m;

  vector<int> aa(50), bb(50);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;

    a--;
    b--;
    g[a][b] = 1;
    g[b][a] = 1;
    aa[i] = a;
    bb[i] = b;
  }

  int ans = 0;

  for (int i = 0; i < m; i++) {
    g[aa[i]][bb[i]] = g[bb[i]][aa[i]] = 0;

    for (int j = 0; j < n; j++) {
      visited[j] = false;
    }

    dfs(0);

    bool brd = 0;
    for (int j = 0; j < n; j++) {
      if (!visited[j]) brd = true;
    }
    if (brd) ans++;

    g[aa[i]][bb[i]] = g[bb[i]][aa[i]] = 1;
  }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:13:28: error: request for member 'size' in 'g[v]', which is of non-class type 'bool [50]'
   13 |   for (int c = 0; c < g[v].size(); c++) {
      |                            ^~~~
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
  int much(int a){
  vector<int> e(a);
  rep(i,a)
  e[i]=find(i);
  sort(all(e)); 
  e.erase(unique(all(e)),e.end());
  return e.size();
  }
};
signed main(){
int a,b;
  cin>>a>>b;
  vector<int> c(b),d(b);
  rep(i,b)
    cin>>c[i]>>d[i];
  int f=0;
  rep(i,b){
    Union e(a);
  rep(j,b){
    e.unite(c[i],d[i]);
   if(j==i)
     continue;
    }
    if(e.much(a)!=1)
      f++;
  }
  cout<<f;


Compiler output:
a.cc: In function 'int main()':
a.cc:68:11: error: expected '}' at end of input
   68 |   cout<<f;
      |           ^
a.cc:51:14: note: to match this '{'
   51 | signed main(){
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long int f[101],e[101][101]，n,m,ans=0,u,v;
inline int ff(int a)
{
    if(f[a]==a)
        return a;
    return f[a]=ff(f[a]);
}
int main(int argc, char** argv)
{
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>u>>v;
        e[u][v]=1,e[v][u]=1;
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            if(e[i][j]==0)
                continue;
            e[i][j]=0;
            for(int k=1;k<=n;k++)
                f[k]=k;
            for(int k=1;k<=n;k++)
            {
                for(int l=k+1;l<=n;l++)
                {
                    if(e[k][l]!=0)
                        f[ff(l)]=ff(k);
                }
            }
            for(int k=2;k<=n;k++)
            {
                if((ff(k)-ff(k-1))!=0)
                {
                    ans++;
                    break;
                }
            }
            e[i][j]=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:3:33: error: expected initializer before '\U0000ff0cn'
    3 | long long int f[101],e[101][101]，n,m,ans=0,u,v;
      |                                 ^~~
a.cc: In function 'int main(int, char**)':
a.cc:12:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   12 |     cin>>n>>m;
      |          ^
      |          yn
a.cc:12:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   12 |     cin>>n>>m;
      |             ^
      |             tm
a.cc:15:14: error: 'u' was not declared in this scope
   15 |         cin>>u>>v;
      |              ^
a.cc:15:17: error: 'v' was not declared in this scope
   15 |         cin>>u>>v;
      |                 ^
a.cc:16:9: error: 'e' was not declared in this scope
   16 |         e[u][v]=1,e[v][u]=1;
      |         ^
a.cc:22:16: error: 'e' was not declared in this scope
   22 |             if(e[i][j]==0)
      |                ^
a.cc:24:13: error: 'e' was not declared in this scope
   24 |             e[i][j]=0;
      |             ^
a.cc:39:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |                     ans++;
      |                     ^~~
      |                     abs
a.cc:46:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAX 1000000000
int dx[] = {1,0,-1,0};
int dy[] = {0,-1,0,1};
const ll INF = 10010010010001;
vector<vector<bool>> graph;
vector<bool> reached;
vector<int> A,B;
int N,M;

void dfs(int v){
    reached[v] = true;
    for(int i=0;i<N;i++){
        if(graph[v][i] == false) continue;
        if(reached[i]) continue;
        dfs(i);
    }
}

//要素数が問題だったなぜか突き止める
int main(){
    cin >> N >> M;
    graph = vector<vector<bool>>(N),vector<bool>(M,false));
    reached = vector<bool>(N);
    A = vector<int>(M);
    B = vector<int>(M);
    for(int i=0;i<M;i++){
        cin >> A[i] >> B[i];
        A[i]--;B[i]--;
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = true;
    }

    int ans = 0;
    for(int i=0;i<M;i++){
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = false;
        for(int j=0;j<N;j++) reached[j] = false;
        dfs(0);
        bool bridge = false;
        for(int j=0;j<N;j++){
            if(reached[j] == false){
                bridge = true;
                break;
            }
        }
        if(bridge) ans++;
        graph[A[i]][B[i]] = graph[B[i]][A[i]] = true;        
    }
    cout << ans << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:58: error: expected ';' before ')' token
   25 |     graph = vector<vector<bool>>(N),vector<bool>(M,false));
      |                                                          ^
      |                                                          ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int limit = 50;
int n, m;
int a[limit], b[limit];
bool graph[limit][limit];
bool visited[limit];

void df(int v) {
    visited[v] = true;
    for (int v2 = 0; v2 < n; ++v2) {
        if (graph[v][v2] == false) continue;
        if (visited[v2] == true) continue;
        dfs(v2);
	}
}

int main(void) {
  cin>>n>>m;
  for(int i = 0; i < m; ++i) {
	cin >> a[i] >> b[i];
	a[i]--, b[i]--;
	graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
  }
  int ans=0;
  for(int i=0;i<m;i++){
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
    for(int j=0;j<n;j++) visited[j]=false;
    df(0);
    bool bridge=false;
    for(int j=0;j<n;j++) if(visited[j]==false) bridge=true;
    if(bridge) ans+=1;
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
    
  }
  cout<<ans<<endl;
  return 0;
}




Compiler output:
a.cc: In function 'void df(int)':
a.cc:14:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   14 |         dfs(v2);
      |         ^~~
      |         ffs
Language: C++

const int limit = 50;
int n, m;
int a[limit], b[limit];
bool graph[limit][limit];
bool visited[limit];

void dfs(int v) {
    visited[v] = true;
    for (int v2 = 0; v2 < n; ++v2) {
        if (graph[v][v2] == false) continue;
        if (visited[v2] == true) continue;
        dfs(v2);
	}
}

int main(void) {
  cin>>n>>m;
  for(int i = 0; i < m; ++i) {
	cin >> a[i] >> b[i];
	a[i]--, b[i]--;
	graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
  }
  int ans=0;
  for(int i=0;i<m;i++){
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=false;
    for(int j=0;j<n;j++) visited[j]=false;
    dfs(0);
    bool bridge=false;
    for(int j=0;j<n;j++) if(visited[j]==false) bridge=true;
    if(bridge) ans+=1;
    graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;
    
  }
  cout<<ans<<endl;
  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'cin' was not declared in this scope
   17 |   cin>>n>>m;
      |   ^~~
a.cc:34:3: error: 'cout' was not declared in this scope
   34 |   cout<<ans<<endl;
      |   ^~~~
a.cc:34:14: error: 'endl' was not declared in this scope
   34 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const ll mod = 1000000007;

vector<int> visited;

void dfs(const Graph &G, int v) {

    visited[v] = 1;

    rep(u, n) {
        if(G[u][v] && !visited[u]) {
            dfs(G, u);
        }
    }

}

int main() {
    int n, m;
    cin >> n >> m;    

    Graph G(n, vector<int>(n));
    vector<int> a(m), b(m);
    rep(i, m) {
        cin >> a[i] >> b[i];
        a[i]--;  b[i]--;
        G[a[i]][b[i]] = G[b[i]][a[i]] = 1;
    }

    int ans = 0;
    rep(i, m) {

        G[a[i]][b[i]] = G[b[i]][a[i]] = 0;

        visited.assign(n, 0);

        dfs(G, 0);

        rep(j, n) {
            if(!visited[j]) {
                ans++;
                break;
            } 
        }
        
        G[a[i]][b[i]] = G[b[i]][a[i]] = 1;

    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(const Graph&, int)':
a.cc:23:12: error: 'n' was not declared in this scope
   23 |     rep(u, n) {
      |            ^
a.cc:11:38: note: in definition of macro 'rep'
   11 | #define rep(i, n) for(int i = 0; i < n; i++)
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;


int a,b;
int c[50],d[50];
bool graph[50][50];
bool vis[50];

void dfs(int v){
  if(vis[x]) return ;
  vis[x] =true ;
  for(int i=0;i<a;i++){
    
    if (graph[x][i]){
      dfs(i);
    }
  }
}
int main(void){
  	cin >>a >>b;
  for (int i=0;i<a; i++){
    cin >> c[i] >> d[i];
    c[i]--;
    d[i]--;
    graph[c[i]][d[i]]=graph[d[i]][c[i]]=true;
  }
  int e=0;
  for (int i=0;i<b; i++){
    graph[c[i]][d[i]]=graph[d[i]][c[i]]=false;
    
    for(int j=0;j<a;j++)vis[j]=false;
    dfs(0);
    
    bool connect = true;
    for(int j=0;j<a;j++)
      
      if(!vis[j]) bridge=true;
    if(connect) e++;
    graph[c[i]][d[i]]=graph[d[i]][c[i]]=true;
  }
  
      cout << e << endl;
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:11:10: error: 'x' was not declared in this scope
   11 |   if(vis[x]) return ;
      |          ^
a.cc:12:7: error: 'x' was not declared in this scope
   12 |   vis[x] =true ;
      |       ^
a.cc: In function 'int main()':
a.cc:38:19: error: 'bridge' was not declared in this scope
   38 |       if(!vis[j]) bridge=true;
      |                   ^~~~~~
Language: C++

n, m = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(m)]

graph = {x:[] for x in range(1, n+1)}
for x, y in ab:
    graph[x].append(y)
    graph[y].append(x)

def dfs(v):
    visited.append(v)
    for v2 in graph[v]:
        if v2 not in visited:
            dfs(v2)

res = 0
for a, b in ab:
    graph[a].remove(b)
    graph[b].remove(a)
    visited = []
    dfs(1)
    if len(visited) != n:
        res += 1
    graph[a].append(b)
    graph[b].append(a)

print(res)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for x, y in ab:
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n,m,ans;
int a[60],b[60];
bool IsBridge(int i){
  queue<int> q;
  bool r[60]={};
  q.push(a[i]);
  r[a[i]]=true;
  while(q.size()){
    int now=q.front(); q.pop;
    for(int j=0;j<n;j++){
      if(i==j) continue;
      if(a[j]==now&&r[b[j]]==false){
        q.push(b[j]);
        b[j]=true;
      }if(b[j]==now&&r[a[j]]==false){
        q.push(a[j]);
        a[j]=true;
      }
    }
  }
  return r[b[i]];
}
int main(){
  cin>>>n>>m;
  for(int i=0;i<m;i++){
    cin>>a[i]>>b[i];
  }
  for(int i=0;i<n;i++)if(IsBridge(i))ans++;
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'bool IsBridge(int)':
a.cc:11:26: error: invalid use of non-static member function 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
   11 |     int now=q.front(); q.pop;
      |                        ~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:316:7: note: declared here
  316 |       pop()
      |       ^~~
a.cc: In function 'int main()':
a.cc:26:8: error: expected primary-expression before '>' token
   26 |   cin>>>n>>m;
      |        ^
Language: C++

#include <iostream>
using namespace std;
void _main() {
    int N, M;
	int A[101], B[101];
    cin >> N >> M;
    rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
 
    int ans = 0;
    rep(i, 0, M) {
        UnionFind uf(N);
        rep(j, 0, M) if (j != i) uf(A[j], B[j]);
        int c = 0;
        rep(j, 0, N) if (j == uf[j]) c++;
        if (1 < c) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
      |     ^~~
Language: C++

#include <iostream>
using namespace std;
int N, M;
int A[101], B[101];

void _main() {
    cin >> N >> M;
    rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
 
    int ans = 0;
    rep(i, 0, M) {
        UnionFind uf(N);
        rep(j, 0, M) if (j != i) uf(A[j], B[j]);
        int c = 0;
        rep(j, 0, N) if (j == uf[j]) c++;
        if (1 < c) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i, 0, M) cin >> A[i] >> B[i], A[i]--, B[i]--;
      |     ^~~