Language: C++

using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int (i)=0; (i) < (n); (i)++)

ll N, M;
vector<ll> V(50, 0);
vector<vector<ll>> D(50, vector<ll>(50, 0));

void DFS(ll num) {
        if (V[num] == 1) return;
        V[num] = 1;

        rep(i,N) {
                if (num == i) continue;
                if (D[num][i] == 1) {
                        DFS(i);
                }
        }
}

int main()
{
        cin >> N >> M;
        vector<ll> a(M, 0);
        vector<ll> b(M, 0);
        rep(i,M) {
                ll aa, bb; cin >> aa >> bb;
                a[i] = aa-1; b[i] = bb-1;
                D[a[i]][b[i]] = 1;
                D[b[i]][a[i]] = 1;
        }
        ll ans = 0;
        rep(i, M) {
                D[a[i]][b[i]] = 0; D[b[i]][a[i]] = 0;
                rep(j,N) V[j] = 0;
                DFS(0);
                bool bridge = false;
                rep(j,N) {
                        if (V[j] == 0) {
                                bridge = true;
                                break;
                        }
                }
                if (bridge) ans++;
                D[a[i]][b[i]] = 1; D[b[i]][a[i]] = 1;
        }
        cout << ans << endl;
}


Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<ll> V(50, 0);
      | ^~~~~~
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<vector<ll>> D(50, vector<ll>(50, 0));
      | ^~~~~~
a.cc: In function 'void DFS(ll)':
a.cc:11:13: error: 'V' was not declared in this scope
   11 |         if (V[num] == 1) return;
      |             ^
a.cc:12:9: error: 'V' was not declared in this scope
   12 |         V[num] = 1;
      |         ^
a.cc:16:21: error: 'D' was not declared in this scope
   16 |                 if (D[num][i] == 1) {
      |                     ^
a.cc: In function 'int main()':
a.cc:24:9: error: 'cin' was not declared in this scope
   24 |         cin >> N >> M;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:25:9: error: 'vector' was not declared in this scope
   25 |         vector<ll> a(M, 0);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:25:18: error: expected primary-expression before '>' token
   25 |         vector<ll> a(M, 0);
      |                  ^
a.cc:25:20: error: 'a' was not declared in this scope
   25 |         vector<ll> a(M, 0);
      |                    ^
a.cc:26:18: error: expected primary-expression before '>' token
   26 |         vector<ll> b(M, 0);
      |                  ^
a.cc:26:20: error: 'b' was not declared in this scope
   26 |         vector<ll> b(M, 0);
      |                    ^
a.cc:30:17: error: 'D' was not declared in this scope
   30 |                 D[a[i]][b[i]] = 1;
      |                 ^
a.cc:35:17: error: 'D' was not declared in this scope
   35 |                 D[a[i]][b[i]] = 0; D[b[i]][a[i]] = 0;
      |                 ^
a.cc:36:26: error: 'V' was not declared in this scope
   36 |                 rep(j,N) V[j] = 0;
      |                          ^
a.cc:40:29: error: 'V' was not declared in this scope
   40 |                         if (V[j] == 0) {
      |                             ^
a.cc:48:9: error: 'cout' was not declared in this scope
   48 |         cout << ans << endl;
      |         ^~~~
a.cc:48:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:24: error: 'endl' was not declared in this scope
   48 |         cout << ans << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;