Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef pair<int, int> P;

const ll MAX_N = 50;

class UnionFindTree {
private:
	int par[MAX_N];
	int rank[MAX_N];
	int siz[MAX_N];

public:
	void init(int n) {
		for (int i = 0; i<n; i++) {
			par[i] = i;
			rank[i] = 0;
			siz[i] = 1;
		}
	}

	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;

		if (rank[x] < rank[y]) {
			par[x] = y;
			siz[y] += siz[x];
		}
		else {
			par[y] = x;
			if (rank[x] == rank[y])rank[x]++;
			siz[x] += siz[y];
		}
	}

	bool same(int x, int y) {
		return find(x) == find(y);
	}

	int size(int x) {
		x = find(x);
		return siz[x];
	}
};

int main() {
	int n, m, ans = 0;
	vector<P> es;
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		P ed;
		cin >> ed.first >> ed.second;
		ed.first--; ed.second--;
		es.push_back(ed);
	}
	for (int i = 0; i < es.size(); i++) {
		UnionFindTree g;
		g.init(n);
		for (int j = 0; j < es.size(); j++) {
			if (i == j)continue;
			g.unite(es[j].first, es[j].second);
		}
		if (!g.same(es[i].first, es[i].second))ans++;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:9:7: error: 'll' does not name a type
    9 | const ll MAX_N = 50;
      |       ^~
a.cc:13:17: error: 'MAX_N' was not declared in this scope
   13 |         int par[MAX_N];
      |                 ^~~~~
a.cc:14:18: error: 'MAX_N' was not declared in this scope
   14 |         int rank[MAX_N];
      |                  ^~~~~
a.cc:15:17: error: 'MAX_N' was not declared in this scope
   15 |         int siz[MAX_N];
      |                 ^~~~~
a.cc: In member function 'void UnionFindTree::init(int)':
a.cc:20:25: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   20 |                         par[i] = i;
      |                         ^~~
      |                         __pstl::execution::v1::par
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc:21:30: error: redeclaration of 'auto i'
   21 |                         rank[i] = 0;
      |                              ^
a.cc:19:26: note: 'int i' previously declared here
   19 |                 for (int i = 0; i<n; i++) {
      |                          ^
a.cc:21:35: error: class template argument deduction failed:
   21 |                         rank[i] = 0;
      |                                   ^
a.cc:21:35: error: no matching function for call to 'rank(int)'
In file included from /usr/include/c++/14/bits/move.h:37,
                 from /usr/include/c++/14/bits/exception_ptr.h:41,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidate: 'template<class> rank()-> std::rank< <template-parameter-1-1> >'
 1437 |     struct rank
      |            ^~~~
/usr/include/c++/14/type_traits:1437:12: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/type_traits:1437:12: note: candidate: 'template<class> rank(std::rank< <template-parameter-1-1> >)-> std::rank< <template-parameter-1-1> >'
/usr/include/c++/14/type_traits:1437:12: note:   template argument deduction/substitution failed:
a.cc:21:35: note:   mismatched types 'std::rank< <template-parameter-1-1> >' and 'int'
   21 |                         rank[i] = 0;
      |                                   ^
a.cc:22:25: error: 'siz' was not declared in this scope; did you mean 'size'?
   22 |                         siz[i] = 1;
      |                         ^~~
      |                         size
a.cc: In member function 'int UnionFindTree::find(int)':
a.cc:27:21: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   27 |                 if (par[x] == x) {
      |                     ^~~
      |                     __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc: In member function 'void UnionFindTree::unite(int, int)':
a.cc:40:25: error: expected unqualified-id before '[' token
   40 |                 if (rank[x] < rank[y]) {
      |                         ^
a.cc:41:25: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   41 |                         par[x] = y;
      |                         ^~~
      |                         __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc:42:25: error: 'siz' was not declared in this scope; did you mean 'size'?
   42 |                         siz[y] += siz[x];
      |                         ^~~
      |                         size
a.cc:45:25: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   45 |                         par[y] = x;
      |                         ^~~
      |                         __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc:46:33: error: expected unqualified-id before '[' token
   46 |                         if (rank[x] == rank[y])rank[x]++;
      |                                 ^
a.cc:46:55: error: expected initializer before '++' token
   46 |                         if (rank[x] == rank[y])rank[x]++;
      |                                                       ^~
a.cc:46:55: error: expected ';' before '++' token
a.cc:47:25: error: 'siz' was not declared in this scope; did you mean 'size'?
   47 |                         siz[x] += siz[y];
      |                         ^~~
      |                         size
a.cc: In member function 'int UnionFindTree::size(int)':
a.cc:57:24: error: 'siz' was not declared in this scope; did you mean 'size'?
   57 |                 return siz[x];
      |                        ^~~
      |                        size