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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <tuple>
#include <cmath>
using namespace std;
typedef long long ll;
//typedef pair<ll, ll> P;

#define rep(i, m) for(ll i=0;i<(m);i++)
#define rep1(i, m) for(ll i=1;i<=(m);i++)
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

struct BIND {int s, t, v; };

template<typename T> struct UnionFind {
   vector<T> data;
   UnionFind(T size):data(size){
      for(T i=0;i<size;i++) {
         data[i] = i;
      }
   }
   bool unite(T x, T y) {
      x = root(x); y = root(y);
      if (x != y) {
         if (data[y] < data[x]) std::tie(x, y) = std::tie(y, x);
         data[x] += data[y]; data[y] = x;
      }
      return x != y;
   }
   bool same(T x, T y) {
      return root(x) == root(y);
   }
   bool sameall() {
      return all_of(data.begin(), data.end(), [](T x){ return same(0, x);});
   }

   T root(T x) {
      return data[x] == x ? x: data[x] = root(data[x]);
   }
};

int main() {
   int N, M;
   cin >> N >> M;
   vector<int> a(N), b(N);
   rep(i, N) {
      cin >> a[i] >> b[i];
      a[i]--;
      b[i]--;
   }

   int cnt = 0;
   rep(i, M) {
      UnionFind<int> uf(N);
      rep(j, M) {
         if (i == j) continue;
         uf.unite(a[j], b[j]);
      }
      cnt += uf.sameall();
   }
   cout << cnt << endl;

/*
   vector<BIND> bs;
   rep(i, N) {
      bs.push_back((BIND){s[i], s[i+1], v[i]});
   }
   bs.push_back((BIND){0,0,0});
   bs.push_back((BIND){s[N],s[N],0});

   int prev_v = 0; int dist = 0;
   for (int u=2;u<=s[N];u+=2) {
      int minval = 10000000;
      rep(i, N+2) {
         BIND b = bs[i];
         if (u < b.s) {
            minval = min(minval, b.v + b.s - u);
         } else if (u > b.t) {
            minval = min(minval, b.v + u-b.t);
         } else {
            minval = min(minval, b.v);
         }
      }
      dist += prev_v + minval;
      prev_v = minval;
   }
   printf("%.91f\n", dist/16.0);*/
}

Compiler output:
a.cc: In instantiation of 'bool UnionFind<T>::sameall() [with T = int]':
a.cc:64:24:   required from here
   64 |       cnt += uf.sameall();
      |              ~~~~~~~~~~^~
a.cc:39:67: error: 'this' was not captured for this lambda function
   39 |       return all_of(data.begin(), data.end(), [](T x){ return same(0, x);});
      |                                                               ~~~~^~~~~~
a.cc:39:67: error: cannot call member function 'bool UnionFind<T>::same(T, T) [with T = int]' without object
Language: C++

#include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()

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(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  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;
  }

  int ans = 0;

  REP(i, m) {
    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;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:15: error: invalid types 'int[int]' for array subscript
   60 |     graph[a[i][b[i]] = graph[b[i]][a[i]] = true;
      |               ^
a.cc:60:48: error: expected ']' before ';' token
   60 |     graph[a[i][b[i]] = graph[b[i]][a[i]] = true;
      |                                                ^
      |                                                ]
Language: C++

#include<bits/stdc++.h>

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;

int n,m;
int a[3000], b[3000];
bool graph[3000][3000], temp_graph[3000][3000];
vector <bool> visited(100,false);

int dfs(int src){
  visited[src] = true;
  rep(i,1,n+1){
    if(temp_graph[src][i]&&!visited[i])dfs(i);//深さ優先探索で到達判定
  }
}
// void init(){
//   rep(i,0,m){
//     temp_graph[a[i]][b[i]]=true;
//     temp_graph[b[i]][a[i]]=true;
//   }
//   rep(i,0,visited.size())visited[i]=false;
// }

int main(){
  cin >> n >> m;
  rep(i,0,m){
    cin >> a[i] >> b[i];
    graph[a[i]][b[i]]=true;
    graph[b[i]][a[i]]=true;
  }
  init();
  int ans =0;
  rep(i,0,m){
    graph[a[i]][b[i]] = false;
    graph[b[i]][a[i]] = false;
    dfs(1);

    bool bridge=false;
    rep(i,1,n+1) if(visited[i]==false) bridge=true;
    if(bridge)ans+=1;

    graph[a[i]][b[i]] = true;
    graph[b[i]][a[i]] = true;
    rep(i,1,n+1) visited[i]=false;

  }
  cout << ans << endl;

}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | }
      | ^
a.cc: In function 'int main()':
a.cc:39:3: error: 'init' was not declared in this scope; did you mean 'int'?
   39 |   init();
      |   ^~~~
      |   int
Language: C++

#include <bits/stdc++.h>
#define inf 1000000000 //1E+9
using namespace std;
struct gragh{
	int V,E;
	vector<vector<pair<int,int>>> edge; //edge[from][i] ={to,cost}
	//only for 0-indexed 
	init(int v,int e,int *from,int *to,int *cost){
		edge.resize(0);	V=v;E=e;	pair<int,int>p;
		for(int i=0;i<e;i++){
			//if(edge.size()<=from[i])edge.resize(from[i]+1);
			edge.resize(v);
			p.first=to[i];	p.second=cost[i];	edge[from[i]].push_back(p);
			p.first=from[i]; p.second=cost[i];	edge[to[i]].push_back(p);
		} }
	int dijkstra(int start,int goal){
		int done[V];	for(int i=0;i<V;i++)done[i]=0;	done[start]=1;
		int vertex[V];	for(int i=0;i<V;i++)vertex[i]=inf;	vertex[start]=0;
		queue<int> que;	que.push(start);
		int from, to, cost;
		while(que.size()!=0){
			from=que.front();
			for(int i=0; i<edge[from].size(); i++){
				to=edge[from][i].first;	cost=edge[from][i].second;
				if( vertex[to]>vertex[from]+cost){
					vertex[to]=vertex[from]+cost;
					que.push(to);
				}
			}
			que.pop();
		}
		return vertex[goal];	}
	};
	
	
int main(){
	int n, m; cin>>n>>m;
	int a[m], b[m];	for(int i=0;i<m;i++)cin>>a[i]>>b[i];
	gragh g;
	int a2[m-1], b2[m-1], c[m-1];
	int ans=0;
	for(int i=0; i<m; i++){
		for(int j=0; j<m; j++){
			if(i>j){a2[j]=a[j]; b2[j]=b[j]; c[j]=1; }
			if(i<j){a2[j-1]=a[j]; b2[j-1]=b[j]; c[j-1]=1;}
		}
		g.init(n,m-1,a2,b2,c);
		for(int j=0; j<n; j++){
		for(int k=j+1; k<n; k++){
			if(g.dijkstra(j,k)==inf){ ans++; k=n; j=n; }
		}
		}
	}

	cout<<ans<<endl;

	return 0;
}



Compiler output:
a.cc:8:9: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
    8 |         init(int v,int e,int *from,int *to,int *cost){
      |         ^~~~
a.cc: In member function 'int gragh::init(int, int, int*, int*, int*)':
a.cc:15:19: warning: no return statement in function returning non-void [-Wreturn-type]
   15 |                 } }
      |                   ^
Language: C++

#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(signed i=0;i<n;++i) #define repi(n) rep(i,n) #define repvin(n) vint a(n);r(i,n)cin>>a[i]; #define int long long #define str string #define vint vector<signed> #define pint pair<signed,signed> #define pb(a) push_back(a) #define all(v) v.begin(),v.end() #define yn(b) cout<<((b)?"Yes":"No")<<endl #define YN(b) cout<<((b)?"YES":"NO")<<endl #define call(a) for(auto t:a)cout<<t<<" ";cout<<endl #define ENDL printf("\n"); #define debg(a) cout<<#a<<":"<<a<<endl; #define SORT(a) sort(all(a)); signed main(){ int n,m; cin>>n>>m; if(n>m){cout<<m<<endl;return 0;} vint a(m),b(m); repi(m)cin>>a[i]>>b[i]; vint adj[60]; queue<signed> que; bool f[n+1]; int res=0,s; rep(i,n){ rep(j,n){ f[j+1]=false; if(i==j)continue; adj[a[j]].pb(b[j]); adj[b[j]].pb(a[j]); s=a[j]; } //bfs,all f is true rep(j,adj[s].size())que.push(adj[s][j]); f[s]=true; while(!que.empty()){ int v=que.front(); que.pop(); for(signed j=0;j<adj[v].size();++j){ if(!f[adj[v][j]])f[adj[v][j]]=true; que.push(adj[v][j]); adj[v].erase(adj[v].begin()+j); } } bool ans=false; for(int b=1;b<n+1;++b)if(!f[b])ans=true; if(ans)res++; } cout<<res<<endl; return 0; } 


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h> using namespace std; #define rep(i,n) for(signed i=0;i<n;++i) #define repi(n) rep(i,n) #define repvin(n) vint a(n);r(i,n)cin>>a[i]; #define int long long #define str string #define vint vector<signed> #define pint pair<signed,signed> #define pb(a) push_back(a) #define all(v) v.begin(),v.end() #define yn(b) cout<<((b)?"Yes":"No")<<endl #define YN(b) cout<<((b)?"YES":"NO")<<endl #define call(a) for(auto t:a)cout<<t<<" ";cout<<endl #define ENDL printf("\n"); #define debg(a) cout<<#a<<":"<<a<<endl; #define SORT(a) sort(all(a)); signed main(){ int n,m; cin>>n>>m; if(n>m){cout<<m<<endl;return 0;} vint a(m),b(m); repi(m)cin>>a[i]>>b[i]; vint adj[60]; queue<signed> que; bool f[n+1]; int res=0,s; rep(i,n){ rep(j,n){ f[j+1]=false; if(i==j)continue; adj[a[j]].pb(b[j]); adj[b[j]].pb(a[j]); s=a[j]; } //bfs,all f is true rep(j,adj[s].size())que.push(adj[s][j]); f[s]=true; while(!que.empty()){ int v=que.front(); que.pop(); for(signed j=0;j<adj[v].size();++j){ if(!f[adj[v][j]])f[adj[v][j]]=true; que.push(adj[v][j]); adj[v].erase(adj[v].begin()+j); } } bool ans=false; for(int b=1;b<n+1;++b)if(!f[b])ans=true; if(ans)res++; } cout<<res<<endl; return 0; }
      |                         ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,c=0;
int a[50],b[50];
bool g[50][50];
bool vi[50];
void dfs(int v) {
  vi[v]=true;
  for(int v2=0; v2<n;v2) {
    if(!g[v][v2]) continue;
    if(vi[v2]) continue;
    dfs(v2);
  }
}
int main(){
  cin>>n>>m;
  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++) v[j]=false;
    dfs(0);
    bool br=false;
    for(int j=0;j<n;j++)
      if(!v[j]) br=true;
    if(br) c++;
    g[a[i]][b[i]]=g[b[i]][a[i]]=true;
  }
  cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: 'v' was not declared in this scope
   24 |     for (int j=0;j<n;j++) v[j]=false;
      |                           ^
a.cc:28:11: error: 'v' was not declared in this scope
   28 |       if(!v[j]) br=true;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,c=0;
int a[50],b[50];
bool g[50][50];
bool vi[50];
void dfs(int v) {
  vi[v]=true;
  for(int v2=0; v2<n;v2) {
    if(!g[v][v2]) continue;
    if(vi[v2]) continue;
    dfs(v2);
  }
}
int main(){
  cin>>n>>m;
  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++) v[j]=false;
    dfs(0);
    bool br=false;
    for(int j=0;j<n;j++)
      if(!v[j]) br=true;
    if(br) c++;
    g[a[i]][b[i]]=g[b[i]][a[i]]=true;
  }
  cout<<c<<;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: 'v' was not declared in this scope
   24 |     for (int j=0;j<n;j++) v[j]=false;
      |                           ^
a.cc:28:11: error: 'v' was not declared in this scope
   28 |       if(!v[j]) br=true;
      |           ^
a.cc:32:12: error: expected primary-expression before ';' token
   32 |   cout<<c<<;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,e[10001][10001]={0},root,num[10001]={0},low[10001]={0},in,c=0;
int min(int a,int b)
{
	return a<b?a:b;
}
void dfs(int cur,int father)
{
	int i;
	index++;
	num[cur]=in;
	low[cur]=in;
	for(i=1;i<=n;i++)
	{
		if(e[cur][i]==1)
		{
			if(num[i]==0)
			{
				dfs(i,cur);
				low[cur]=min(low[i],low[cur]);
				if(low[i]>num[cur])
					c++;
			}
			else
				if(i!=father)
				{
					low[cur]=min(low[cur],num[i]);
				}
		}
	}
	return ;
}
int main( )
{
	int i,j,x,y;
	cin>>n>>m;
	for(i=1;i<+n;i++)
		for(j=1;j<+n;j++)
			e[i][j]=0;
	for(i=1;i<=m;i++)
	{
		cin>>x>>y;
		e[x][y]=1;
		e[y][x]=1;
	}
	root=1;
	dfs(1,root);
	cout<<c<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:11:14: error: no post-increment operator for type
   11 |         index++;
      |              ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,e[10001][10001]={0},root,num[10001]={0},low[10001]={0},index,c=0;
int min(int a,int b)
{
	return a<b?a:b;
}
void dfs(int cur,int father)
{
	int i;
	index++;
	num[cur]=index;
	low[cur]=index;
	for(i=1;i<=n;i++)
	{
		if(e[cur][i]==1)
		{
			if(num[i]==0)
			{
				dfs(i,cur);
				low[cur]=min(low[i],low[cur]);
				if(low[i]>num[cur])
					c++;
			}
			else
				if(i!=father)
				{
					low[cur]=min(low[cur],num[i]);
				}
		}
	}
	return ;
}
int main( )
{
	int i,j,x,y;
	cin>>n>>m;
	for(i=1;i<+n;i++)
		for(j=1;j<+n;j++)
			e[i][j]=0;
	for(i=1;i<=m;i++)
	{
		cin>>x>>y;
		e[x][y]=1;
		e[y][x]=1;
	}
	root=1;
	dfs(1,root);
	cout<<c<<endl;
	return 0;
}

Compiler output:
a.cc:3:64: error: 'int index' redeclared as different kind of entity
    3 | int n,m,e[10001][10001]={0},root,num[10001]={0},low[10001]={0},index,c=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:11:14: error: no post-increment operator for type
   11 |         index++;
      |              ^~
a.cc:12:18: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
   12 |         num[cur]=index;
      |                  ^~~~~
a.cc:13:18: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
   13 |         low[cur]=index;
      |                  ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,e[55][55],num[55],low[55];
int root,index,ans=0;
void dfs(int cur,int dad)
{
    int i;
    index++;
    num[cur]=low[cur]=index;
    for(i=1;i<=n;i++)
    {
        if(e[cur][i]==1)
        {
            if(num[i]==0)
            {
                dfs(i,cur);
                low[cur]=min(low[cur],low[i]);
                if(low[i]>num[cur])
                   ans++;
            }
            else if(i!=dad)
                low[cur]=min(low[cur],num[i]);
        }
    }
}
int main()
{
    int i,a,b;
    cin>>n>>m;
    for(i=1;i<=m;i++)
    {
       cin>>a>>b;
        e[a][b]=1;
        e[b][a]=1;
    }
    root=1;
    dfs(1,root);
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc:4:10: error: 'int index' redeclared as different kind of entity
    4 | int root,index,ans=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:8:10: error: no post-increment operator for type
    8 |     index++;
      |          ^~
a.cc:9:23: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
    9 |     num[cur]=low[cur]=index;
      |                       ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int> G[500];
int n,m,u,v,dep,ans,dfn[500],low[500];
void tarjan(int u,int fa)
{
    dfn[u]=low[u]=++dep;
    for(int i=0;i<G[u].size();i++)
    {
        int v=G[u][i];
        if(!dfn[v])
        {
            Tarjan(v,u);
            low[u]=min(low[u],low[v]);
            if(low[v]>dfn[u])
            {
                ans++;
            } 
        }else{
        	if(v!=fa)
        	{
        		low[u]=min(low[u],dfn[v]);
            }
        }
    }
}
int main()
{
    while(cin>>n>>m)
    {
        dep=ans=0;
  		memset(dfn,0,sizeof(dfn));
  	 	memset(low,0,sizeof(low));
   	 	for(int i=0;i<=n;i++)
        {
            G[i].clear();
        } 
        for(int i=0;i<m;i++)
        {
            cin>>u>>v;
            G[u].push_back(v);
            G[v].push_back(u);
        }
        tarjan(1,-1);
        cout<<ans<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void tarjan(int, int)':
a.cc:13:13: error: 'Tarjan' was not declared in this scope; did you mean 'tarjan'?
   13 |             Tarjan(v,u);
      |             ^~~~~~
      |             tarjan
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000
int d[MAX_V][MAX_V];
int V;
void warshall_floyd() {
	rep(k, 0, V) rep(i, 0, V) rep(j, 0, V) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int M;
	cin >> V >> M;
	vector<int> a(M), b(M);
	rep(i, 0, V) rep(j, 0, V) {
		if(i == j) d[i][j] = 0;
		else d[i][j] = 1e9;
	}
	rep(i, 0, M) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		d[a[i]][b[i]] = 1;
		d[b[i]][a[i]] = 1;
	}

	int rsl = 0;
	rep(i, 0, M) {
		rep(j, 0, V) rep(k, 0, V) {
			if(j == k) d[j][k] = 0;
			else d[j][k] = 1e9;
		}
		rep(j, 0, M) {
			d[a[j]][b[j]] = 1;
			d[b[j]][a[j]] = 1;
		}
		d[a[i]][b[i]] = 1e9;
		d[b[i]][a[i]] = 1e9;
		warshall_floyd();
		rep(j, 0, V) {
			bool flag = false;
			rep(k, j + 1, V) {
				if(d[j][k] == 1e9) {
					flag = true;
					break;
				}
			}
			if(flag) {
				rsl++;
				break;
			}
		}
		d[a[i]][b[i]] = 1;
		d[b[i]][a[i]] = 1;
	}

	cout << rsl << endl;
}


Compiler output:
/tmp/ccvKQCGE.o: in function `warshall_floyd()':
a.cc:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0xf8): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x10b): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
/tmp/ccvKQCGE.o: in function `main':
a.cc:(.text+0x149): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x24c): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x25b): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x443): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x452): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x62a): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
a.cc:(.text+0x645): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccvKQCGE.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;
bool isNotBridge(int m, int** sideSet,
		 int index);
bool isRoot(int m, int a, int b,
	    int* unableSideSet, int cnt,
	    int** sideSet);
bool isUnable(int i, int* unableSideSet, int cnt);
int main() {
  int n, m; cin >> n >> m;
  int bcnt = 0;
  int** sideSet;
  sideSet = new int*[m];
  for(int i = 0; i < m; i++)
    sideSet[i] = new int[2];
  for(int i = 0; i < m; i++)
    for(int j = 0; j < 2; j++)
      cin >> sideSet[i][j];

  for(int i = 0; i < m; i++)
    if(isNotBridge(m, sideSet, i + 1));
    else ++bcnt;
  cout << bcnt << endl;
  
  for(int i = 0; i < m; i++)
    delete[] sideSet[i];
  delete[] sideSet;
}
bool isNotBridge(int m, int** sideSet,
		 int index) {
  int a = sideSet[index - 1][0],
      b = sideSet[index - 1][1];
  int unableSideSet[m], cnt = 0;
  unableSideSet[0] = index; ++cnt;
  if(isRoot(m, a, b, unableSideSet, cnt, sideSet))
    return true;
  else return false;
}
bool isRoot(int m, int a, int b,
	   int* unableSideSet, int cnt,
	   int** sideSet) {
  for(int i = 0; i < m; i++) {
    if(isUnable(i, unableSideSet, cnt)) 
      continue}
    for(int k = 0; k < 2; k++) {
      if(sideSet[i][k] == a) {
	if((k == 0 && sideSet[i][1] == b)
	   || (k == 1 && sideSet[i][0] == b))
	  return true;
	unableSideSet[cnt] = i + 1;
	++cnt;
	if(k == 0 &&
	   isRoot(m, sideSet[i][1], b, unableSideSet,
		  cnt, sideSet)) return true;
	else if(k == 1 &&
		isRoot(m, sideSet[i][0], b,
		       unableSideSet, cnt, sideSet))
	  return true;
	else --cnt;
      } 
    }
  }
  return false;
}
bool isUnable(int i, int* unableSideSet, int cnt) {
  for(int j = 0; j < cnt; j++)
    if((unableSideSet[j] - 1) == i)
      return true;
  return false;
}


Compiler output:
a.cc: In function 'bool isRoot(int, int, int, int*, int, int**)':
a.cc:44:15: error: expected ';' before '}' token
   44 |       continue}
      |               ^
      |               ;
a.cc:46:18: error: 'i' was not declared in this scope
   46 |       if(sideSet[i][k] == a) {
      |                  ^
a.cc: At global scope:
a.cc:63:3: error: expected unqualified-id before 'return'
   63 |   return false;
      |   ^~~~~~
a.cc:64:1: error: expected declaration before '}' token
   64 | }
      | ^
a.cc: In function 'bool isRoot(int, int, int, int*, int, int**)':
a.cc:62:3: warning: control reaches end of non-void function [-Wreturn-type]
   62 |   }
      |   ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <climits>
#include <sstream>

using namespace std;
 
int N, M, a[51], b[51];
bool graph[51][51];
bool visited[51];
 
void dfs(int v){

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

}
 
int main(){

    cin >> N >> M;
    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;
    }
 
    int ans = 0;
    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;

        visited[0] = true;
 
        dfs(0);

        for(int j = 1; j < N; j++){
            if(visited[j] == false){
                ans++;
                break;
            }
        }

        g[a[i]][b[i]] = g[b[i]][a[i]] = true;
    }
 
    cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'g' was not declared in this scope
   32 |         g[a[i]][b[i]] = g[b[i]][a[i]] = true;
      |         ^
a.cc:38:9: error: 'g' was not declared in this scope
   38 |         g[a[i]][b[i]] = g[b[i]][a[i]] = false;
      |         ^
Language: C++

#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
using namespace std;
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}
int gcd(int x, int y){
	if(x<y){
    return gcd(y,x);
  }
  if(y==0){
    return x;
  }
  return gcd(y,x%y);
}
int moji(char i){
  if(i=='a'){
    return 1;
  }
  if(i=='b'){
    return 2;
  }
  if(i=='c'){
    return 3;
  }
  if(i=='d'){
    return 4;
  }
  if(i=='e'){
    return 5;
  }
  if(i=='f'){
    return 6;
  }
  if(i=='g'){
    return 7;
  }
  if(i=='h'){
    return 8;
  }
  if(i=='i'){
    return 9;
  }
  if(i=='j'){
    return 10;
  }
  if(i=='k'){
    return 11;
  }
  if(i=='l'){
    return 12;
  }
  if(i=='m'){
    return 13;
  }
  if(i=='n'){
    return 14;
  }
  if(i=='o'){
    return 15;
  }
  if(i=='p'){
    return 16;
  }
  if(i=='q'){
    return 17;
  }
  if(i=='r'){
    return 18;
  }
  if(i=='s'){
    return 19;
  }
  if(i=='t'){
    return 20;
  }
  if(i=='u'){
    return 21;
  }
  if(i=='v'){
    return 22;
  }
  if(i=='w'){
    return 23;
  }
  if(i=='x'){
    return 24;
  }
  if(i=='y'){
    return 25;
  }
  if(i=='z'){
    return 26;
  } 
  return 100;
  
}




bool graph[60][60];
bool tansaku(int i){
  for(int k=0;k<60;k++){
    if(graph[i][k]){
      if(tansaku(k)){
        graph[i][k]=false;
      }
    }
  }
  return true;
}
int main() {
  int N,M;
  cin>>N>>M;
  memset(graph,false,sizeof(graph));
  int a[51];
  int b[51];
  for(int i=0;i<M;i++){
    cin>>a[i]>>b[i];
    graph[a[i]][b[i]]=true;
  }
  int sum=0;
  for(int i=0;i<M;i++){
    graph[a[i]][b[i]]=false;
    tansaku(b[i]);
    bool handan=false;
    for(int l=0;l<60;l++){
      for(int m=0;m<60;m++){
        if(graph[l][m]){
          handan=true;
          

        }
      }
      if(l==59&&handan){
        sum++;
      }
    }
    for(int j=0;j<M;j++){
    graph[a[j]][b[j]]=true;
  }

    
  }
  cout<<sum<<endl;
  
  
  



  
  
  


  
  


  

  




  
  
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:131:3: error: 'memset' was not declared in this scope
  131 |   memset(graph,false,sizeof(graph));
      |   ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<cstdio>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include "pch.h"
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#include <bitset>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main() {
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int k, i, n, m, cnt = 0;
	cin >> n >> m;
	vector<int> a(m);
	vector<int> b(m);
	for (i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		a[i]--;
		b[i]--;
	}
	for (k = 0; k < m; k++) {
		queue<int> bfs;
		vector<int> flag(n, false);
		vector<vector<int>> adj(n);
		for (i = 0; i < m; i++) {
			if (i != k) {
				adj[a[i]].push_back(b[i]);
				adj[b[i]].push_back(a[i]);
			}
		}
		bfs.push(0);
		flag[0] = true;
		while (!bfs.empty()) {
			int current = bfs.front();
			bfs.pop();
			for (int next : adj[current]) {
				if (flag[next] == false) {
					bfs.push(next);
					flag[next] = true;
				}
			}
		}
		for (i = 0; i < n; i++) {
			if (flag[i] == false) break;
		}
		if (i < n) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: pch.h: No such file or directory
    2 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <utility>
//#include "../cxx-prettyprint/prettyprint.hpp"

std::vector<std::pair<int, int>> edges;
std::vector<std::set<int>> graph_original;
std::vector<std::set<int>> graph;
std::vector<bool> visited;

bool can_reach(int a, int b) {
    visited[a] = true;
    if (graph[a].empty()) {
        return false;
    } else if (std::find(graph[a].begin(), graph[a].end(), b) != graph[a].end()) {
        return true;
    } else {
        for (int next : graph[a]) {
            if (visited[next]) continue;
            if (can_reach(next, b)) return true;
        }
        return false;
    }
}

int main() {
    int N, M;
    std::cin >> N >> M;

    graph_original.resize(N + 1);

    for (int i = 0; i < M; i ++) {
        int a, b;
        std::cin >> a >> b;
        edges.push_back({a, b});
        graph_original[a].insert(b);
        graph_original[b].insert(a);
    }

    int n_bridges = 0;
    for (auto edge : edges) {
        graph = graph_original;
        graph[edge.first].erase(edge.second);
        graph[edge.second].erase(edge.first);
        visited.assign(N + 1, false);

        bool is_bridge = !can_reach(edge.first, edge.second);
        n_bridges += is_bridge;
    }
    std::cout << n_bridges << std::endl;
}


Compiler output:
a.cc: In function 'bool can_reach(int, int)':
a.cc:16:25: error: no matching function for call to 'find(std::set<int>::iterator, std::set<int>::iterator, int&)'
   16 |     } else if (std::find(graph[a].begin(), graph[a].end(), b) != graph[a].end()) {
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:16:25: note:   'std::_Rb_tree_const_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |     } else if (std::find(graph[a].begin(), graph[a].end(), b) != graph[a].end()) {
      |                ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
Language: C++

#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
#define MAX 50

int brigde[MAX][MAX]={0};
int visited[MAX]={0};
int n, m;
int a[MAX], b[MAX];
void dfs(int a);

int main(void) {
    cin >> n >> m;
    int i, j;
    int cnt=0;
    for(i=0; i<m; i++) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        brigde[a[i]][b[i]]=brigde[b[i]][a[i]]=1;
    }
    
    for(i=0; i<m; i++) {
        brigde[a[i]][b[i]]=brigde[b[i]][a[i]]=0;
        dfs(0);
        for(j=0; j<n; j++) {
            if(visited[j]==0) {
                cnt++;
                break;
            }
        }
        brigde[a[i]][b[i]]=brigde[b[i]][a[i]]=1;
        for(j=0; j<n; j++)
            visited[j]=0;
    }
    cout << cnt << endl;
    return 0;
}

void dfs(int a) {
    int i;
    visited[a]=1;
    
    for(i=0; i<n; i++) {
        if(brigde[a][i]==0);
        else if(visited[i]==1);
        else dfs(i);
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'cin' was not declared in this scope
   20 |     cin >> n >> m;
      |     ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include <stack>
  +++ |+#include <iostream>
    8 | using namespace std;
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout << cnt << endl;
      |     ^~~~
a.cc:42:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:20: error: 'endl' was not declared in this scope
   42 |     cout << cnt << endl;
      |                    ^~~~
a.cc:8:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    7 | #include <stack>
  +++ |+#include <ostream>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

const int limit=50;
int N,M;
int a[limit]={0},b[limit]={0};

bool graph[limit][limit];
bool visited[limit];

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

int main(){

  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<M;j++) visited[j]=false;
    bridge=false;
    dfs();
    for(int j=0;j<M;j++) if(visited[i]==false) bridge=true;
    if(bridge) ans+=1;
    graph[a[i]][b[i]]==graph[b[i]][a[i]]=true;
  }

  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:22: error: lvalue required as left operand of assignment
   42 |     graph[a[i]][b[i]]==graph[b[i]][a[i]]=false;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:44:5: error: 'bridge' was not declared in this scope
   44 |     bridge=false;
      |     ^~~~~~
a.cc:45:8: error: too few arguments to function 'void dfs(int)'
   45 |     dfs();
      |     ~~~^~
a.cc:22:6: note: declared here
   22 | void dfs(int x){
      |      ^~~
a.cc:48:22: error: lvalue required as left operand of assignment
   48 |     graph[a[i]][b[i]]==graph[b[i]][a[i]]=true;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;

const int limit=50;
int N,M;
int a[limit]={0},b[limit]={0};

bool graph[limit][limit];
bool visited[limit];

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

int main(){

  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<M;j++) visited[j]=false;
    bridge=false;
    dfs();
    for(int j=0;j<M;j++) if(visited[i]==false) bridge=true;
    if(bridge) ans+=1;
    graph[a[i]][b[i]]==graph[b[i]][a[i]]=true;
  }

  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: expected ',' or ';' before 'for'
   41 |   for(int i=0;i<M;i++){
      |   ^~~
a.cc:41:15: error: 'i' was not declared in this scope
   41 |   for(int i=0;i<M;i++){
      |               ^
Language: Java

import java.util.Scanner;

public class training2 {
	Scanner scan;
	int n;
	int m;

	int[] a;
	int[] b;

	boolean[] judge;
	int count;
	boolean[][] connect;

	public static void main(String args[]){
		new training2().compute();
	}
	void compute() {
		scan=new Scanner(System.in);

		n=scan.nextInt();
		m=scan.nextInt();

		a=new int[m];
		b=new int[m];

		for(int i=0;i<m;i++) {
			a[i]=scan.nextInt();
			b[i]=scan.nextInt();
		}
		judge=new boolean[n];
		count=0;
		connect=new boolean[n][n];


		for(int i=0;i<m;i++) {
			connect[a[i]-1][b[i]-1]=true;
			connect[b[i]-1][a[i]-1]=true;
		}

		for(int i=0;i<m;i++) {
			for(int j=0;j<n;j++) {
				judge[j]=false;
			}
			connect[a[i]-1][b[i]-1]=false;
			connect[b[i]-1][a[i]-1]=false;
			dfs(0);
		}
		for(int i=0;i<n;i++) {
			if(!judge[i]) {
				count++;
			}
		}
		System.out.println(count-2);
	}
	void dfs(int x) {
		judge[x]=true;
		for(int i=0;i<n;i++) {
			if((connect[x][i])&&(!judge[i])) {
				dfs(i);
			}
		}
	}
}

Compiler output:
Main.java:3: error: class training2 is public, should be declared in a file named training2.java
public class training2 {
       ^
1 error
Language: C++

/// Author: Yen-Jen Wang
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 50 + 7;

struct Dsu {
	int n, cc;
	int par[MAX_N];
	int sz[MAX_N];

	void init(int _n) {
		n = _n;
		cc = n;
		for (int i = 1; i <= n; i++) {
			par[i] = i;
			sz[i] = 1;
		}
	}

	int find(int x) {
		return par[x] == x ? x : (par[x] = find(par[x]));
	}

	bool merge(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y)
			return 1;
		cc--;
		if (sz[x] < sz[y])
			swap(x, y);
		sz[x] += sz[y];
		par[y] = x;
		return 1;
	}
};

int main() {
	int N, M;
	cin >> N >> M;
	vector<pair<int, int> > es;
	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		es.emplace_back(a, b);
	}
	int ans = 0;
	for (int i = 0; i < M; i++) {
		dsu.init(N);
		for (int j = 0; j < M; j++) {
			if (j != i)
				dsu.merge(es[j].first, es[j].second);
		}
		if (dsu.cc != 1)
			ans++;
	}
	cout << ans << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'dsu' was not declared in this scope; did you mean 'Dsu'?
   51 |                 dsu.init(N);
      |                 ^~~
      |                 Dsu
Language: C++

#include<bits/stdc++.h>
using namespace std;
int root,index,n,m,ans;
int num[55],low[55];
vector<int> ve[55];
void dfs(int cur,int father)
{
    index++;
    num[cur]=index;
    low[cur]=index;
    for(int i=0;i<ve[cur].size();i++){
        int qq=ve[cur][i];
        if(num[qq]==0){
            dfs(qq,cur);
            low[cur]=min(low[qq],low[cur]);
            if(low[qq]>num[cur]){
                ans++;
            }
        }
        else if(qq!=father){
            low[cur]=min(low[cur],num[qq]);
        }
    }
}
int main()
{
    while(scanf("%d%d",&n,&m)!=EOF){
        for(int i=0;i<=n;i++) ve[i].clear();
        for(int i=0;i<m;i++){
            int a,b;
            scanf("%d%d",&a,&b);
            ve[a].push_back(b);
            ve[b].push_back(a);
        }
        root=1;
        ans=index=0;
        dfs(1,root);
        printf("%d\n",ans);
    }
    return 0;
}


Compiler output:
a.cc:3:10: error: 'int index' redeclared as different kind of entity
    3 | int root,index,n,m,ans;
      |          ^~~~~
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:8:10: error: no post-increment operator for type
    8 |     index++;
      |          ^~
a.cc:9:14: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
    9 |     num[cur]=index;
      |              ^~~~~
a.cc:10:14: error: cannot resolve overloaded function 'index' based on conversion to type 'int'
   10 |     low[cur]=index;
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:36:19: error: overloaded function with no contextual type information
   36 |         ans=index=0;
      |                   ^
Language: Java

import java.util.*;

public class Bridge {

    static Set<Integer> cnt = new HashSet<>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int vertices = sc.nextInt();
        int edges = sc.nextInt();
        List<List<Integer>> edge = new ArrayList<>();

        for (int i = 0; i < edges; i++) {
            edge.add(Arrays.asList(sc.nextInt(), sc.nextInt()));
        }


        int ans = 0;
        for (int i = 0; i < edges; i++) {
            List<Integer> e = edge.remove(i);
            connected(mapGen(edge), edge.get(0).get(0));
            if (cnt.size() != vertices) ans++;
            cnt.clear();
            edge.add(i, e);
        }

        System.out.println(ans);

    }

    private static Map<Integer, List<Integer>> mapGen(List<List<Integer>> edges) {
        Map<Integer, List<Integer>> g = new HashMap<>();
        for (int i = 0; i < edges.size(); i++) {
            int v = edges.get(i).get(0);
            int w = edges.get(i).get(1);
            if (!g.containsKey(v)) g.put(v, new ArrayList<>());
            if (!g.containsKey(w)) g.put(w, new ArrayList<>());

            g.get(v).add(w);
            g.get(w).add(v);
        }

        return g;
    }

    private static void connected(Map<Integer, List<Integer>> g, int v) {
        if (cnt.contains(v)) return;
        cnt.add(v);
        for (int w : g.get(v)) {
            connected(g, w);
        }
    }
}


Compiler output:
Main.java:3: error: class Bridge is public, should be declared in a file named Bridge.java
public class Bridge {
       ^
1 error
Language: C++

//
// C - Bridge
//

#include <iostream>
#include <vector>

using namespace std;

int main() {

    int N, M;
    cin >> N >> M;

    vector<int> G[N + 1];

    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    int count = 0;
    bool changed = true;

    while (changed) {
        changed = false;
        for (int i = 1; i <= N; i++) {
            if (G[i].size() == 1) {
                G[i].clear();
                count++;
                changed = true;
                for (int j = 1; j <= N; j++) {
                    G[j].erase(remove(G[j].begin(), G[j].end(), i), G[j].end());
                }
            }
        }
    }

    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:49: error: cannot convert 'std::vector<int>::iterator' to 'const char*'
   35 |                     G[j].erase(remove(G[j].begin(), G[j].end(), i), G[j].end());
      |                                       ~~~~~~~~~~^~
      |                                                 |
      |                                                 std::vector<int>::iterator
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:5:
/usr/include/stdio.h:158:32: note:   initializing argument 1 of 'int remove(const char*)'
  158 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~
Language: C++

# include <iostream>
# include <vector>
# define pf push_front
# define pb push_back
# define mp make_pair
# define pr printf
# define se second
# define si size()
# define sc scanf
# define fi first
# define er erase
# define be begin
# define ss size
# define Int __int64
# define INF 100000000000000008
# define MOD 1000000007
# define MN 500500
# define eps 0.0000000000000000018
# define mem(a) memset(a,0,sizeof(a))
# define cpy(b,a) memcpy(b,a,sizeof(a))
#define fast ios_base::sync_with_stdio(false)
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
using namespace std;
int a[55][55],vis[55];
void dfs(int n){
	vis[n]=1;
	for(int i=0;i<55;i++){
		if(a[n][i]==1 && !vis[i])dfs(i);
	}
}
int main() {
	int x,y,n,m,i,j,ans(0);
	cin>>n>>m;
	vector< pair<int,int> >v;
	for(i=0;i<m;i++){
		cin>>x>>y;
		a[x][y]=1;
		a[y][x]=1;
		v.pb(mp(x,y));
	}
	for(i=0;i<v.si;i++){
		x=v[i].first;
		y=v[i].second;
		a[x][y]=0;
		a[y][x]=0;
		dfs(1);
		for(j=1;j<=n;j++){
			if(!vis[j]){
				ans++;
				break;
			}
		}
		a[x][y]=1;
		a[y][x]=1;
		mem(vis);
	}
	cout<<ans;
	return 0;
}
/* and its only us now */


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
   19 | # define mem(a) memset(a,0,sizeof(a))
      |                 ^~~~~~
a.cc:56:17: note: in expansion of macro 'mem'
   56 |                 mem(vis);
      |                 ^~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | # include <vector>
  +++ |+#include <cstring>
    3 | # define pf push_front
Language: C++

#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<sstream>
#include<list>
#include<queue>
#include <algorithm>
#include<initializer_list>
#include<map>
#include<set>
using namespace std;
int conSize(int n, int m, vector<vector<int>> g, int begin, vector<int> &color) {
	if (color[begin] == 1) return 0;
	int size = 1;
	color[begin] = 1;
	for (int i = 0; i < g[begin].size(); i++) {
		size += conSize(n, m, g, g[begin][i], color);
	}
	return size;
}
int main() {
	int n, m;
	cin >> n >> m;
	vector<vector<int>> g(n, vector<int>());
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		g[a - 1].push_back(b - 1);
		g[b - 1].push_back(a - 1);
	}
	int bridge = 0;
	vector<int> color(n, 0);
	vector<int> cc = color;
	int iniSize = conSize(n, m, g, 0, cc);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < g[i].size(); j++) {
			vector<vector<int>> g2 = g;
			int deleteEdgeNode1 = i;
			int deleteEdgeNode2 = g2[i][j];
			for (auto it = g2[deleteEdgeNode2].begin(); it != g2[deleteEdgeNode2].end();) {
				if (*it == deleteEdgeNode1) it = g2[deleteEdgeNode2].erase(it);
				else ++it;
			}
			g2[i].erase(g2[i].begin() + j);
			vector<int> cc = color;
			int newSize = conSize(n, m, g2, 0, vector<int>(n, 0));
			if (newSize != iniSize)bridge++;
		}
	}
	cout << bridge/2;
	return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:49:60: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
   49 |                         int newSize = conSize(n, m, g2, 0, vector<int>(n, 0));
      |                                                            ^~~~~~~~~~~~~~~~~
a.cc:15:74: note:   initializing argument 5 of 'int conSize(int, int, std::vector<std::vector<int> >, int, std::vector<int>&)'
   15 | int conSize(int n, int m, vector<vector<int>> g, int begin, vector<int> &color) {
      |                                                             ~~~~~~~~~~~~~^~~~~