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

#include<cstring>
#include<algorithm>
using namespace std;
char a[100][100];
int b[100][100];
void my(int i,int j)
{
    if(b[i][j]==-1)
        return ;
    b[i][j]++;
}
int main()
{
    int n,m;
    while(cin>>n>>m)
    {
        memset(b,0,sizeof(b));
        for(int i=1;i<=n;i++)
            for(int j=1;j<=m;j++)
            cin>>a[i][j];
        for(int i=1;i<=n;i++)
            for(int j=1;j<=m;j++)
            {
                if(a[i][j]=='#')
                {
                    b[i][j]=-1;
                    my(i-1,j);
                    my(i+1,j);
                    my(i,j-1);
                    my(i,j+1);
                    my(i-1,j-1);
                    my(i-1,j+1);
                    my(i+1,j-1);
                    my(i+1,j+1);
                }
            }
        for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++)
            {
                if(b[i][j]==-1)
                cout<<'#';
                else
                cout<<b[i][j];
            }
            cout<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'cin' was not declared in this scope
   15 |     while(cin>>n>>m)
      |           ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:42:17: error: 'cout' was not declared in this scope
   42 |                 cout<<'#';
      |                 ^~~~
a.cc:42:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:17: error: 'cout' was not declared in this scope
   44 |                 cout<<b[i][j];
      |                 ^~~~
a.cc:44:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:46:13: error: 'cout' was not declared in this scope
   46 |             cout<<endl;
      |             ^~~~
a.cc:46:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:46:19: error: 'endl' was not declared in this scope
   46 |             cout<<endl;
      |                   ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
#define ms(a,b) memset(a,b,sizeof(a))

char m[55][55];
int h,w;
bool f(int a,int b)
{
    if(a<h&&a>=0&&b<w&&b>=0&&m[a][b]=='#') return true;
    return false;
}
int main()
{
    //ios::sync_with_stdio(0);cin.tie(0);
    while(~scanf("%d%d",&h,&w)){
        getchar();
        for(int i=0;i<h;i++) gets(m[i]);
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(f(i,j)){printf("%c",m[i][j]);continue;}
                int ans=0;
                if(f(i-1,j)) ans++;
                if(f(i-1,j+1)) ans++;
                if(f(i-1,j-1)) ans++;
                if(f(i,j-1)) ans++;
                if(f(i,j+1)) ans++;
                if(f(i+1,j)) ans++;
                if(f(i+1,j+1)) ans++;
                if(f(i+1,j-1)) ans++;
                printf("%d",ans);
            }
            printf("\n");
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'gets' was not declared in this scope; did you mean 'getw'?
   24 |         for(int i=0;i<h;i++) gets(m[i]);
      |                              ^~~~
      |                              getw
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
#define ms(a,b) memset(a,b,sizeof(a))

char m[55][55];
int h,w;
bool f(int a,int b)
{
    if(a<h&&a>=0&&b<w&&b>=0&&m[a][b]=='#') return true;
    return false;
}
int main()
{
    //ios::sync_with_stdio(0);cin.tie(0);
    while(~scanf("%d%d",&h,&w)){
        getchar();
        for(int i=0;i<h;i++) gets(m[i]);
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(m[i][j]=='#'){printf("%c",m[i][j]);continue;}
                int ans=0;
                if(f(i-1,j)) ans++;
                if(f(i-1,j+1)) ans++;
                if(f(i-1,j-1)) ans++;
                if(f(i,j-1)) ans++;
                if(f(i,j+1)) ans++;
                if(f(i+1,j)) ans++;
                if(f(i+1,j+1)) ans++;
                if(f(i+1,j-1)) ans++;
                printf("%d",ans);
            }
            printf("\n");
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'gets' was not declared in this scope; did you mean 'getw'?
   24 |         for(int i=0;i<h;i++) gets(m[i]);
      |                              ^~~~
      |                              getw
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
#define ms(a,b) memset(a,b,sizeof(a))

char m[55][55];
int h,w;
bool f(int a,int b)
{
    if(a<h&&a>=0&&b<w&&b>=0) return true;
    return false;
}
int main()
{
    //ios::sync_with_stdio(0);cin.tie(0);
    while(~scanf("%d%d",&h,&w)){
        getchar();
        for(int i=0;i<h;i++) gets(m[i]);
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(m[i][j]=='#'){printf("%c",m[i][j]);continue;}
                int ans=0;
                if(m[i-1][j]=='#'&&f(i-1,j)) ans++;
                if(m[i-1][j+1]=='#'&&f(i-1,j+1)) ans++;
                if(m[i-1][j-1]=='#'&&f(i-1,j-1)) ans++;
                if(m[i][j-1]=='#'&&f(i,j-1)) ans++;
                if(m[i][j+1]=='#'&&f(i,j+1)) ans++;
                if(m[i+1][j]=='#'&&f(i+1,j)) ans++;
                if(m[i+1][j+1]=='#'&&f(i+1,j+1)) ans++;
                if(m[i+1][j-1]=='#'&&f(i+1,j-1)) ans++;
                printf("%d",ans);
            }
            printf("\n");
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'gets' was not declared in this scope; did you mean 'getw'?
   24 |         for(int i=0;i<h;i++) gets(m[i]);
      |                              ^~~~
      |                              getw
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long LL;
#define ms(a,b) memset(a,b,sizeof(a))

char m[55][55];
int h,w;
bool f(int a,int b)
{
    if(a<h&&a>=0&&b<w&&b>=0) return true;
    return false;
}
int main()
{
    //ios::sync_with_stdio(0);cin.tie(0);
    while(~scanf("%d%d",&h,&w)){
        ms(m,'0');
        getchar();
        for(int i=0;i<h;i++) gets(m[i]);
        for(int i=0;i<h;i++){
            for(int j=0;j<w;j++){
                if(m[i][j]=='#'){printf("%c",m[i][j]);continue;}
                int ans=0;
                if(m[i-1][j]=='#'&&f(i-1,j)) ans++;
                if(m[i-1][j+1]=='#'&&f(i-1,j+1)) ans++;
                if(m[i-1][j-1]=='#'&&f(i-1,j-1)) ans++;
                if(m[i][j-1]=='#'&&f(i,j-1)) ans++;
                if(m[i][j+1]=='#'&&f(i,j+1)) ans++;
                if(m[i+1][j]=='#'&&f(i+1,j)) ans++;
                if(m[i+1][j+1]=='#'&&f(i+1,j+1)) ans++;
                if(m[i+1][j-1]=='#'&&f(i+1,j-1)) ans++;
                printf("%d",ans);
            }
            printf("\n");
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: 'gets' was not declared in this scope; did you mean 'getw'?
   25 |         for(int i=0;i<h;i++) gets(m[i]);
      |                              ^~~~
      |                              getw
Language: C

#include<stdio.h>
int main(){
    int H,W,i,j,num;
    scanf("%d %d",H,W);
    char S[H][W+1];
    for(i=0;i<H;i++){
        scanf("%s",S[i]);
    }
    for(i=0;i<H;i++){
        for(j=0;j<W;j++){
            if(S[i][j]=='.'){
                num=0;
                if(i>0){
                    if(j>0){
                        if(S[i-1][j-1]=='#'){num++;}
                    }
                        if(S[i-1][j]=='#'){num++;}
                    if(j<W-1){
                        if(S[i-1][j+1]=='#'){num++;}
                    }
                }
                if(j>0){
                        if(S[i][j-1]=='#'){num++;}
                }
                if(j<W-1){
                        if(S[i][j+1]=='#'){num++;}
                }
                if(i<H-1){
                    if(j>0){
                        if(S[i+1][j-1]=='#'){num++;}
                    }
                        if(S[i+1][j]=='#'){num++;}
                    if(j<W-1){
                        if(S[i+1][j+1]=='#'){num++;}
                    }
                }
                s[i][j]='0'+num;
            }
        }
    }
    for(i=0;i<H;i++){
        printf("%s\n",S[i]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:37:17: error: 's' undeclared (first use in this function)
   37 |                 s[i][j]='0'+num;
      |                 ^
main.c:37:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
#include <cmath>
using namespace std;



int main(void){
  int H, W;
  cin >> H >> W;
  char m[H][W];
  for(int i=0; i<H; i++)
    for(int j=0; j<W; j++)
      cin >> m[i][j];

  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      if(m[i][j]=='.'){
        int jib=0;
        if(i>0){
          if(m[i-1][j]=='#')jib++;
          if(j>0) if(m[i-1][j-1]=='#')jib++;
          if(j<W-1) if(m[i-1][j+1]=='#')jib++;
        }
        if(j>0) if(m[i][j-1]=='#')jib++;
        if(j<w-1) if(m[i][j+1]=='#')jib++;
        if(i<H-1){
          if(m[i+1][j]=='#')jib++;
          if(j>0) if(m[i+1][j-1]=='#')jib++;
          if(j<W-1) if(m[i+1][j+1]=='#')jib++;
        }
        cout << jib;
      }else{
        cout << "#";
      }
      if(j==W-1)cout<<endl;
    }
  }
  cout <<
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'w' was not declared in this scope
   26 |         if(j<w-1) if(m[i][j+1]=='#')jib++;
      |              ^
a.cc:40:3: error: expected primary-expression before 'return'
   40 |   return 0;
      |   ^~~~~~
Language: Java

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class AtCoderBeginner075B {
	static Scanner sc;
	static char[][] map;
	static int H, W;

	public static void main(String[] args) throws Exception {
		//InputStream in = new FileInputStream("src/input.txt");
		InputStream in = System.in;

		sc = new Scanner(in);

		H = sc.nextInt();
		W = sc.nextInt();

		map = new char[H][W];
		for(int h = 0; h < H; h++){
			String line = sc.next();
			for(int w = 0; w < W; w++){
				map[h][w] = line.charAt(w);
			}
		}

		for(int h = 0; h < H; h++){
			for(int w = 0; w < W; w++){
				if(map[h][w] == '#'){
					System.out.print("#");
				}else{
					System.out.print(count(h, w));
				}
			}
			System.out.println();
		}
	}

	public static int count(int h, int w){
		int answer = 0;

		for(int i = -1; i <= 1; i++){
			for(int j = -1; j <= 1; j++){
				try{
					if(map[h+i][w+j] == '#'){
						answer++;
					}
				}catch (Exception e) {
					// TODO: handle exception
				}
			}
		}

		return answer;
	}
}

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

#include <iostream>
#include <string>
#include <cmath>
using namespace std;



int main(void){
  int H, W;
  cin >> H >> W;
  char m[H][W];
  for(int i=0; i<H; i++)
    for(int j=0; j<W; j++)
      cin >> m[i][j];

  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      if(m[i][j]=='.'){
        int ijb=0;
        if(i>0){
          if(m[i-1][j]=='#')jib++;
          if(j>0) if(m[i-1][j-1]=='#')jib++;
          if(j<W-1) if(m[i-1][j+1]=='#')jib++;
        }
        if(j>0) if(m[i][j-1]=='#')jib++;
        if(j<w-1) if(m[i][j+1]=='#')jib++;
        if(i<H-1){
          if(m[i+1][j]=='#')jib++;
          if(j>0) if(m[i+1][j-1]=='#')jib++;
          if(j<W-1) if(m[i+1][j+1]=='#')jib++;
        }
        cout << jib;
      }else{
        cout << "#";
      }
      if(j==W-1)cout<<endl;
    }
  }
  cout <<
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   21 |           if(m[i-1][j]=='#')jib++;
      |                             ^~~
      |                             ijb
a.cc:22:39: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   22 |           if(j>0) if(m[i-1][j-1]=='#')jib++;
      |                                       ^~~
      |                                       ijb
a.cc:23:41: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   23 |           if(j<W-1) if(m[i-1][j+1]=='#')jib++;
      |                                         ^~~
      |                                         ijb
a.cc:25:35: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   25 |         if(j>0) if(m[i][j-1]=='#')jib++;
      |                                   ^~~
      |                                   ijb
a.cc:26:14: error: 'w' was not declared in this scope
   26 |         if(j<w-1) if(m[i][j+1]=='#')jib++;
      |              ^
a.cc:26:37: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   26 |         if(j<w-1) if(m[i][j+1]=='#')jib++;
      |                                     ^~~
      |                                     ijb
a.cc:28:29: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   28 |           if(m[i+1][j]=='#')jib++;
      |                             ^~~
      |                             ijb
a.cc:29:39: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   29 |           if(j>0) if(m[i+1][j-1]=='#')jib++;
      |                                       ^~~
      |                                       ijb
a.cc:30:41: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   30 |           if(j<W-1) if(m[i+1][j+1]=='#')jib++;
      |                                         ^~~
      |                                         ijb
a.cc:32:17: error: 'jib' was not declared in this scope; did you mean 'ijb'?
   32 |         cout << jib;
      |                 ^~~
      |                 ijb
a.cc:40:3: error: expected primary-expression before 'return'
   40 |   return 0;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <functional>
#include <limits>
#include <queue>
#include <iomanip>
#include <deque>
#include <stack>
#include <cstdio>
#include <cmath>
#include <complex.h>
#include <cstdio>
#include <random>
#include <chrono>
#include <numeric>
#include <cassert>
#include <iso646.h>
#include <exception>
#include <stdexcept>

using namespace std;

typedef long long i64;

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

#ifndef ONLINE_JUDGE
    FILE *stream;
    freopen_s(&stream, "input.txt", "r", stdin);
    // freopen_s(&stream, "output.txt", "w", stdout);
#endif

    int rows, cols;
    cin >> rows >> cols;

    char grid[50][50];
    for (int r = 0; r < rows; r++)
        for (int c = 0; c < cols; c++)
            cin >> grid[r][c];

    for (int r = 0; r < rows; r++)
        for (int c = 0; c < cols; c++)
            if (grid[r][c] == '.')
            {
                int bombs = 0;
                for (int dr = -1; dr <= 1; dr++)
                    for (int dc = -1; dc <= 1; dc++)
                    {
                        int r0 = r + dr;
                        int c0 = c + dc;

                        bool good_r = r0 >= 0 && r0 < rows;
                        bool good_c = c0 >= 0 && c0 < cols;

                        if (good_r && good_c)
                            bombs += grid[r0][c0] == '#';
                    }

                grid[r][c] = bombs + '0';
            }

    for (int r = 0; r < rows; r++)
    {
        for (int c = 0; c < cols; c++)
            cout << grid[r][c];
        cout << '\n';
    }
        
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'freopen_s' was not declared in this scope; did you mean 'freopen64'?
   37 |     freopen_s(&stream, "input.txt", "r", stdin);
      |     ^~~~~~~~~
      |     freopen64
Language: C++

#include <bits/stdc++.h>
using namespace std;
void dfs(vector<vector<int>>vector<int>B,vector<bool> A,int N,int M){
  A[N]=true;
  for(int i=0;i<M;i++){
    if(!B[i][N])continue;
    if(A[i])continue;
    dfs(B,A,i,M);
  }
}
int main(){
  int N,M;cin>>N>>M;
  vector<pair<int,int>>A(M);
  bool Graph[N][N];
  for(int i=0;i<M;i++){
    cin>>A[i].first>>A[i].second;
    A[i].first--;A[i].second--;
    Graph[A[i].first][A[i].second]=true;
    Graph[A[i].second][A[i].first]=true;
  }
  int ans=0;
  for(int i=0;i<M;i++){
    Graph[A[i].first][A[i].second]=false;
    Graph[A[i].second][A[i].first]=false;
    vector<bool>went(N,false);
    dfs(Graph,went,0,N);
    bool a=false;
    for(int j=0;j<N;j++)if(!went[j])a=true;
    if(a)ans++;
    Graph[A[i].first][A[i].second]=true;
    Graph[A[i].second][A[i].first]=true;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:3:40: error: expected unqualified-id before 'B'
    3 | void dfs(vector<vector<int>>vector<int>B,vector<bool> A,int N,int M){
      |                                        ^
a.cc:3:40: error: expected ')' before 'B'
    3 | void dfs(vector<vector<int>>vector<int>B,vector<bool> A,int N,int M){
      |         ~                              ^
      |                                        )
a.cc:3:40: error: expected initializer before 'B'
a.cc: In function 'int main()':
a.cc:26:5: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   26 |     dfs(Graph,went,0,N);
      |     ^~~
      |     ffs
Language: C++

#include <bits/stdc++.h>
using namespace std;
void dfs(vector<vector<int>>B,vector<bool> A,int N,int M){
  A[N]=true;
  for(int i=0;i<M;i++){
    if(!B[i][N])continue;
    if(A[i])continue;
    dfs(B,A,i,M);
  }
}
int main(){
  int N,M;cin>>N>>M;
  vector<pair<int,int>>A(M);
  bool Graph[N][N];
  for(int i=0;i<M;i++){
    cin>>A[i].first>>A[i].second;
    A[i].first--;A[i].second--;
    Graph[A[i].first][A[i].second]=true;
    Graph[A[i].second][A[i].first]=true;
  }
  int ans=0;
  for(int i=0;i<M;i++){
    Graph[A[i].first][A[i].second]=false;
    Graph[A[i].second][A[i].first]=false;
    vector<bool>went(N,false);
    dfs(Graph,went,0,N);
    bool a=false;
    for(int j=0;j<N;j++)if(!went(j))a=true;
    if(a)ans++;
    Graph[A[i].first][A[i].second]=true;
    Graph[A[i].second][A[i].first]=true;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: could not convert '(bool (*)[N])(& Graph)' from 'bool (*)[N]' to 'std::vector<std::vector<int> >'
   26 |     dfs(Graph,went,0,N);
      |         ^~~~~
      |         |
      |         bool (*)[N]
a.cc:28:33: error: no match for call to '(std::vector<bool>) (int&)'
   28 |     for(int j=0;j<N;j++)if(!went(j))a=true;
      |                             ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool Graph[50][50];
void dfs(vector<int> A,int N){
}
int main(){
  int N,M;cin>>N>>M;
  vector<pair<int,int>>A(M);
  for(int i=0;i<M;i++){
    cin>>A[i].first>>A[i].second;
    A[i].first--;A[i].second--;
    Graph[A[i].first][A[i].second]=true;
    Graph[A[i].second][A[i].first]=true;
  }
  int ans=0:
  for(int i=0;i<M;i++){
    Graph[A[i].first][A[i].second]=false;
    Graph[A[i].second][A[i].first]=false;
    vector<bool>went(N,false);
    dfs(went,0);
    bool a=false;
    for(int j=0;j<N;j++)if(!went(j))a=true;
    if(a)ans++;
  }
  cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
    vector<int> par, size;
    UnionFind(int x) {
        par.resize(x);
        size.resize(x, 1);
        for (int i = 0; i < x; i++) {
            par[i] = i;
        }
    }
    int find(int x) {
        if (par[x] == x)
            return x;
        return par[x] = find(par[x]);
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
    int consize(int x) {
        return size[find(x)];
    }
    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y)
            return;
        if (size[x] < size[y]) {
            par[x] = y;
            size[y] += size[x];
        }
        else {
            par[y] = x;
            size[x] += size[y];
        }
    }
};
int main(){
  int N,M;cin>>N>>M;
  vector<pair<int,int>>A(M);
  for(int i=0;i<M;i++)cin>>A[i].first>>A[i].second;
  int ans=0;
  for(int i=0;i<M;i++){
    UnionFind B(N);
    for(int j=0;j<M;j++)if(i!=j)B.unite(A[j].first,A[j].second);
    bool b=false;
    for(int j=0;j<N;j++)if(find(j)!=0)b=true;
    if(b)ans++;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:32: error: no matching function for call to 'find(int&)'
   47 |     for(int j=0;j<N;j++)if(find(j)!=0)b=true;
      |                            ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:3842:5: note: candidate: 'template<class _IIter, class _Tp> _IIter std::find(_IIter, _IIter, const _Tp&)'
 3842 |     find(_InputIterator __first, _InputIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:3842:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::find(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
   60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:60:1: note:   candidate expects 4 arguments, 1 provided
In file included from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/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, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

import sys
N, M = map(int, sys.stdin.readline().split())
graph = [[False for i in range(N)] for i in range(N)]
ab = []
for i in range(M):
    a, b = map(int, sys.stdin.readline().split())
    a -= 1
    b -= 1
    ab.append([a, b])
    graph[a][b] = graph[b][a] = True

all_use = (1 << N) - 1


def rec(v, use):
    use |= 1 << v
    for u in range(N):
        if (not graph[u][v]) or (use >> u) & 1:
            continue
        use |= rec(u, use)
    return use


ans = 0
for a, b in ab:
    graph[a][b] = graph[b][a] = False
    if rec(0, 0) != all_use:
        ans += 1
    graph[a][b] = graph[b][a] = True
print(ans)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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

    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> es(m);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        es[i] = {a, b};
    }

    int cnt = 0;
    for (int i = 0; i < m; i++) {
        bool ok = false;
        vector<vector<int>> adj(n);
        for (int j = 0; j < m; j++) {
            if (i == j) continue;
            int a = es[j].first, b = es[j].second;
            adj[a].push_back(b);
            adj[b].push_back(a);
        }
        vector<bool> visited(n);
        int cnt = 0;
        auto dfs = [&](auto& dfs, int v) -> void {
            visited[v] = true;
            cnt++;
            for (int a : adj[v]) {
                if (!visited[a]) dfs(dfs, a);
            }
        };
        dfs(dfs, 0);
        if (cnt != n) ok = true;
        if (ok) cnt++;
    }

    cout << cnt a<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:16: error: expected ';' before 'a'
   42 |     cout << cnt a<< endl;
      |                ^~
      |                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;const int MAXN=2e5;vector<int>G[MAXN];int V[MAXN],L[MAXN],D[MAXN],x,y,cnt,i;__fastcall int f(int u,int p,int d){D[u]=d;L[u]=d;V[u]=1;for(int v:G[u]){if(v==p)continue;if(V[v]){L[u]=min(L[u],D[v]);continue;}f(v,u,d+1);L[u]=min(L[u],L[v]);}}main(){int n,m;cin>>n>>m;for(i=0;i<m;i++){cin>>x>>y;--x,--y;G[x].push_back(y);G[y].push_back(x);}f(0,0,0);for(i=0;i<n;i++)if(L[i]==D[i])cnt++;cout<<cnt-1<<endl;return 0;}

Compiler output:
a.cc:2:97: error: '__fastcall' does not name a type
    2 | using namespace std;const int MAXN=2e5;vector<int>G[MAXN];int V[MAXN],L[MAXN],D[MAXN],x,y,cnt,i;__fastcall int f(int u,int p,int d){D[u]=d;L[u]=d;V[u]=1;for(int v:G[u]){if(v==p)continue;if(V[v]){L[u]=min(L[u],D[v]);continue;}f(v,u,d+1);L[u]=min(L[u],L[v]);}}main(){int n,m;cin>>n>>m;for(i=0;i<m;i++){cin>>x>>y;--x,--y;G[x].push_back(y);G[y].push_back(x);}f(0,0,0);for(i=0;i<n;i++)if(L[i]==D[i])cnt++;cout<<cnt-1<<endl;return 0;}
      |                                                                                                 ^~~~~~~~~~
a.cc:2:259: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;const int MAXN=2e5;vector<int>G[MAXN];int V[MAXN],L[MAXN],D[MAXN],x,y,cnt,i;__fastcall int f(int u,int p,int d){D[u]=d;L[u]=d;V[u]=1;for(int v:G[u]){if(v==p)continue;if(V[v]){L[u]=min(L[u],D[v]);continue;}f(v,u,d+1);L[u]=min(L[u],L[v]);}}main(){int n,m;cin>>n>>m;for(i=0;i<m;i++){cin>>x>>y;--x,--y;G[x].push_back(y);G[y].push_back(x);}f(0,0,0);for(i=0;i<n;i++)if(L[i]==D[i])cnt++;cout<<cnt-1<<endl;return 0;}
      |                                                                                                                                                                                                                                                                   ^~~~
a.cc: In function 'int main()':
a.cc:2:356: error: 'f' was not declared in this scope
    2 | using namespace std;const int MAXN=2e5;vector<int>G[MAXN];int V[MAXN],L[MAXN],D[MAXN],x,y,cnt,i;__fastcall int f(int u,int p,int d){D[u]=d;L[u]=d;V[u]=1;for(int v:G[u]){if(v==p)continue;if(V[v]){L[u]=min(L[u],D[v]);continue;}f(v,u,d+1);L[u]=min(L[u],L[v]);}}main(){int n,m;cin>>n>>m;for(i=0;i<m;i++){cin>>x>>y;--x,--y;G[x].push_back(y);G[y].push_back(x);}f(0,0,0);for(i=0;i<n;i++)if(L[i]==D[i])cnt++;cout<<cnt-1<<endl;return 0;}
      |                                                                                                                                                                                                                                                                                                                                                                    ^
Language: C++

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

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    void reset(int n){ 
        for(int i=0;i<n;i++)par[i] = root(par[i]);
    }
    bool solve(int n) {
        int num=0; 
        for(int i=0;i<n;i++)if(par[i]==par[0])num++;
        return num == n;
    }
};

int main() {
    int n,m;
    cin >> n >> m;
    int a,b;
    pair<int,int> p[n];
    for(int i=0;i<m;i++){
        cin >> a >> b;
        a--; b--;
        p[i]=make_pair(a,b);
    }
    tree.reset(n);    
    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(p[i].first,p[i].second);
        tree.reset(n);
        ans+=(1-tree.solve(n));
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: 'tree' was not declared in this scope; did you mean 'free'?
   43 |     tree.reset(n);
      |     ^~~~
      |     free
Language: C++

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

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    void reset(int n){ 
        for(int i=0;i<n;i++)par[i] = root(par[i]);
    }
    bool solve(int n) {
        int num=0; 
        for(int i=0;i<n;i++)if(par[i]==par[j])num++;
        return num == n;
    }
};

int main() {
    int n,m;
    cin >> n >> m;
    int a,b;
    pair<int,int> p[n];
    for(int i=0;i<m;i++){
        cin >> a >> b;
        a--; b--;
        p[i]=make_pair(a,b);
    }
    tree.reset(n);    
    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(p[i].first,p[i].second);
        tree.reset(n);
        ans+=(1-tree.solve(n));
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In member function 'bool UnionFind::solve(int)':
a.cc:28:44: error: 'j' was not declared in this scope; did you mean 'jn'?
   28 |         for(int i=0;i<n;i++)if(par[i]==par[j])num++;
      |                                            ^
      |                                            jn
a.cc: In function 'int main()':
a.cc:43:5: error: 'tree' was not declared in this scope; did you mean 'free'?
   43 |     tree.reset(n);
      |     ^~~~
      |     free
Language: C++

#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int mat[60][60],used[60][60],visit[60];
int cnt,t,n,m,ans;
void dfs(int src)
{
    visit[src]=t;
    cnt++;
    for(int i=1; i<=n; i++)
    {
        if(mat[src][i] && visit[i]!=t)
            dfs(i);
    }
}
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    cin>>n>>m;
    for(int i=0; i<m; i++)
    {
        int u,v;
        cin>>u>>v;
        mat[u][v]=1;
        mat[v][u]=1;
    }
    for(int i=1; i<=n; i++)
    {
        for(int j=1; j<=n; j++)
        {
            if(mat[i][j] && !used[i][j])
            {
                mat[i][j]=0;
                mat[j][i]=0;
                used[i][j]=1;
                used[j][i]=1;
                t++;
                cnt=0;
                dfs(1);
                mat[i][j]=1;
                mat[j][i]=1;
                if(cnt!=n)
                    ans++;
            }

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


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:19:5: error: reference to 'visit' is ambiguous
   19 |     visit[src]=t;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:15:30: note:                 'int visit [60]'
   15 | int mat[60][60],used[60][60],visit[60];
      |                              ^~~~~
a.cc:23:27: error: reference to 'visit' is ambiguous
   23 |         if(mat[src][i] && visit[i]!=t)
      |                           ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:15:30: note:                 'int visit [60]'
   15 | int mat[60][60],used[60][60],visit[60];
      |                              ^~~~~
Language: C++

//隣接行列でグラフを管理して、DEFで連結判定する
#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];//訪問済みかどうか
//DFS
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 >> 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; //i番目のペアのエッジを削除
    
    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:31:23: error: lvalue required as left operand of assignment
   31 |     graph[a[i]][b[i]] == graph[b[i]][a[i]] = false; //i番目のペアのエッジを削除
      |     ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:40:30: error: two consecutive '[' shall only introduce an attribute before '[' token
   40 |     graph[a[i]][b[i]] = graph[[b[i]][a[i]] = true;//消去したエッジを元に戻す
      |                              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int parent[50 * 50 + 5];
int length[50 * 50 + 5];
 
void init();
int getroot(int n);
bool samegroup(int n, int m);
bool unite(int n, int m);
 
int main(){
  int N, M;//N:ノードの数　M:エッジの数
  cin >> N >> M;
  vector<int> a(M), b(M);//データ数はMで数値はNまでの範囲
  for ( int i = 0; i < M ; i++) cin >> a.at(i) >> b.at(i);
  int ans = 0; //ブリッジとなるエッジの数
  
  for ( int i = 0; i < M ; i++){
    init(); //parent[k] = length[k] = k で初期化
    
    for ( int j = 0; j < M ; j++){
      if ( j == i ) continue;
      unite ( a[j],b[j]); //入力した全aj,bj間をエッジで連結
    }
    
    int parent = getroot(1);
    bool ok = true;
    for ( int i = 1; i <= N; i++){
      if ( !samegroup(parent, i)){
        ok = false;
        break;
      }
    }
    if(!ok) ans++;
  }
}
 
void init(){
for ( int i = 0; i < 50 * 50 + 5; i++){
  parent[i] = i;
  length[i] = i;
}
  return;
}
int getroot(int n){
  if ( parent[n] == n){
    return n;
  } else{
    return getroot(parent[n]);
  }
}
bool samegroup(int n, int m){
  int nroot = getroot(n);
  int mroot = getroot(m);
  if ( nroot == mroot){
    return true;
  } else{
    return false;
  }
}
bool unite(int n, int m){
  if (samegroup(n, m)){
    return false;
  } else{
    int nroot = getroot(n);
    int mroot = getroot(m);
    if (length[nroot] == length[mroot]){
      parent[nroot] = mroot;
      length[mroot]++;
    } else if (length[nroot] > length[mroot]){
      parent[mroot] = nroot;
    } else {
      parent[nroot] = mroot;
    }
    return true;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'bool unite(int, int)':
a.cc:78:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   78 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++


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

#define ll long long int
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define repm(i, a, n) for (ll i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define mod (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vd vector<double>
#define vb vector<bool>
#define vs vector<string>
#define vii vector<vector<int>>
#define vllll vector<vector<ll>>
#define ALL(a) (a).begin(), (a).end()

int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

void print(bool f)
{
    cout << (f ? "Yes" : "No") << endl;
}

void Print(bool f)
{
    cout << (f ? "YES" : "NO") << endl;
}

ll n, m;

bool bfs(vllll path)
{
    vb pass(n, false);
    pass[0] = true;
    queue<int> q;
    q.push(0);z
    int cnt = 1;
    while (!q.empty())
    {
        int sp = q.front();
        q.pop();
        rep(i, 0, n)
        {
            if (path[sp][i] && !pass[i])
            {
                q.push(i);
                pass[i] = true;
                cnt++;
            }
        }
        if (cnt == n)
            return false;
    }
    return true;
}

int main(void)
{
    cin >> n >> m;
    vll a(m), b(m);
    vllll path(n, vll(n));
    rep(i, 0, m)
    {
        cin >> a[i] >> b[i];
        a[i]--, b[i]--;
        path[a[i]][b[i]] = 1;
        path[b[i]][a[i]] = 1;
    }

    ll ans = 0;
    rep(i, 0, m)
    {
        path[a[i]][b[i]] = 0;
        path[b[i]][a[i]] = 0;

        if (bfs(path))
            ans++;

        path[a[i]][b[i]] = 1;
        path[b[i]][a[i]] = 1;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'bool bfs(std::vector<std::vector<long long int> >)':
a.cc:44:15: error: 'z' was not declared in this scope
   44 |     q.push(0);z
      |               ^
a.cc:56:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   56 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:59:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   59 |         if (cnt == n)
      |             ^~~
      |             int
Language: C++

#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
#define Max(a) (*max_element(ALL(a)))
#define Min(a) (*min_element(ALL(a)))
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m;cin>>n>>m;
  vector<pair<ll,ll>>E(m);
  for(auto &a:E){
    cin>>a.F>>a.S;
  }
  ll ans = 0;
  for(int i=0;i<m;i++){
    UF uni(n+10);
    for(int j=0;j<m;j++){
      if(i == j)continue;
      uni.merge(E[i].F,E[i].S);
    }
    ans += (uni.size(0) != n);
  }
  cout<<ans<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'UF' was not declared in this scope; did you mean 'F'?
   30 |     UF uni(n+10);
      |     ^~
      |     F
a.cc:33:7: error: 'uni' was not declared in this scope; did you mean 'unix'?
   33 |       uni.merge(E[i].F,E[i].S);
      |       ^~~
      |       unix
a.cc:35:13: error: 'uni' was not declared in this scope; did you mean 'unix'?
   35 |     ans += (uni.size(0) != n);
      |             ^~~
      |             unix
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:13:2: error: 'cin' was not declared in this scope
   13 |  cin>>n>>m;
      |  ^~~
a.cc:27:1: error: 'cout' was not declared in this scope
   27 | cout << ans << endl;
      | ^~~~
a.cc:27:16: error: 'endl' was not declared in this scope
   27 | cout << ans << endl;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
using namespace std;
using ll = long long;
using ull = unsigned long long;


int main (){
  int n, m; cin >> n >> m;
  vector<vector<int>> vr(m,vector<int>(2, 0));
  for(int i = 0; i < m; i++){
    cin >> vr[i][0] >> vr[i][1];
  } 
  
  int cnt = 0;
  for(int i = 0; i < m; i++){
    vector<bool> conect(n+1, false);
    int x = vr[i][0]; int y = vr[i][1];
    vr[i][0] = 0; vr[i][1] = 0;
    vector<vector<int>> v(n+1,vector<int>(0));
    for(int j = 0; j < m; j++){
    v[vr[j][0]].push_back(vr[j][1]);
    v[vr[j][1]].push_back(vr[j][0]);
    }

    conect[1] = true;
    for(l = 1; l <= n; l++){
    for(int j = 1; j <= n; j++){
      for(int k = 0; k < v[j].size(); k++){
        if(conect[j]){conect[v[j][k]] = true;}
      }
    }
    }
    

    bool f = false;
    for(int j = 1; j <= n; j++){
      if(!conect[j]){f = true; break;}
    }
    if(f){cnt++;}
    vr[i][0] = x; vr[i][1] = y;
  }
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'l' was not declared in this scope
   28 |     for(l = 1; l <= n; l++){
      |         ^
Language: C++

#include <bits/stdc++.h
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,M,i,j,ans=0;cin>>N>>M;
  ll a[M],b[M];
  REP(i,M){
    cin>>a[i]>>b[i];a[i]--;b[i]--;
  }
  REP(i,M){
    vector<bool>seen(N,true);
    queue<ll>X;X.push(0);
    while(X.size()){
      ll F=X.front();
      seen.at(F)=false;
      REP(j,M)if(j!=i){
        if(a[j]==F&&seen.at(b[j]))X.push(b[j]);
        if(b[j]==F&&seen.at(a[j]))X.push(a[j]);
      }
    }
    sort(ALL(seen));
    if(!seen.at(0))ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i =1; i <= (int)(n);++i)
int par[60];
void init(int n){
   rep1(i,n)
     par[i]=i;  
}
int find(int x){
   if(par[x]==x)
     return x;
   else
     return par[x]=find(par[x]); 
}
void unite(int x,int y){
   x=find(x);
   y=find(y);
   if(x==y)
     return;
   par[x]=y; 
}
void same(int x,int y){
   return find(x)==find(y);
}
int main(){
  int n,m,c=0;
  cin>>n>>m;
  int p[m][2];
  rep(i,m)
     cin>>p[i][0]>>p[i][1];
  rep(i,m){
    init(n);
    rep(j,m)
      if(i!=j)
        unite(p[j][0],p[j][1]);
    rep1(j,n)
      if(!same(1,j)){
         c++;
         break; 
      }
  }
  cout<<c;
  return 0;
}

Compiler output:
a.cc: In function 'void same(int, int)':
a.cc:24:18: error: return-statement with a value, in function returning 'void' [-fpermissive]
   24 |    return find(x)==find(y);
      |           ~~~~~~~^~~~~~~~~
a.cc: In function 'int main()':
a.cc:38:15: error: could not convert 'same(1, j)' from 'void' to 'bool'
   38 |       if(!same(1,j)){
      |           ~~~~^~~~~
      |               |
      |               void
a.cc:38:15: error: in argument to unary !
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<int,int>;
//const int INF=1e+11;
const int NMAX=8;
const int MOD=10000;
const int dbase=80*160;
//157d


struct UnionFind {
  vector<int> d;
  UnionFind(int n): d(n,-1) {}//-1で初期化
  int root(int x) {
    if (d[x] < 0) return x;//rootを負にする（構成node数x(-1))
    //root以外は親の番号
    return d[x] = root(d[x]);
    //return(root(d[x]))とするとメモできないが上の書き方だとメモができる
  }
  bool unite(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    //swapすることで小さい方を大きい方につけられ計算量減らせる
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return root(x) == root(y);}
  //同じグループ化
  int size(int x) { return -d[root(x)];}
  //グループのnode数
    int group_num(int n){
        set<int> s;
        for(int i = 0; i < n; ++i){
            s.insert(root(i));
        }
        return int(s.size());}
};

vector<int> to[55];
vector<P> edge(55);

int main(){
	int n,m;
cin>>n>>m;
	rep(i,m){
		int a1,b1;
		cin>>a1>>b1;
		a1--;b1--;
		to[a1].push_back(b1);
		to[b1].push_back(a1);
		edge[i]=make_pair(a1,b1);

	}
	int ans=0;
	rep(i,m){
		UnionFind uf(n);
		rep(j,m){
			if (i!=j) {
				uf.unite(edge[j].first,edge[j].second);
			}
		}
		int tmp=uf.group_num(n);
		if (temp!=1) ans++;
	}

cout<<ans;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:21: error: 'temp' was not declared in this scope; did you mean 'tmp'?
   68 |                 if (temp!=1) ans++;
      |                     ^~~~
      |                     tmp
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)
      |   ^~~