Language: C++

struct UnionFind{
	vector<lint> rnk,par,num;
	UnionFind(lint N) : rnk(N),par(N),num(N){
		init();
	}
	void init(){
		for(lint i = 0;i < rnk.size();i++){
			rnk[i] = 0;#include <bits/stdc++.h>
using namespace std;
using lint = long long;

struct UnionFind{
	vector<lint> rnk,par,num;
	UnionFind(lint N) : rnk(N),par(N),num(N){
		init();
	}
	void init(){
		for(lint i = 0;i < rnk.size();i++){
			rnk[i] = 0;
			par[i] = i;
			num[i] = 1;
		}
	}
	lint find(lint x){
		if(par[x] == x) return x;
		return par[x] = find(par[x]);
	}
	void unite(lint x,lint y){
		x = find(x);
		y = find(y);
		if(x == y) return;
		if(rnk[x] < rnk[y]){
			par[x] = y;
			num[y] += num[x];
		}
		else{
			par[y] = x;
			num[x] += num[y];
			if(rnk[x] == rnk[y]) rnk[x]++;
		}
	}
	bool same(lint x,lint y){
		return (find(x) == find(y));
	}
	lint size(lint x){
		return num[find(x)];
	}
};

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

Compiler output:
a.cc:8:36: error: stray '#' in program
    8 |                         rnk[i] = 0;#include <bits/stdc++.h>
      |                                    ^
a.cc:2:9: error: 'vector' does not name a type
    2 |         vector<lint> rnk,par,num;
      |         ^~~~~~
a.cc:3:23: error: expected ')' before 'N'
    3 |         UnionFind(lint N) : rnk(N),par(N),num(N){
      |                  ~    ^~
      |                       )
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:1:17: note: to match this '{'
    1 | struct UnionFind{
      |                 ^
a.cc: In member function 'void UnionFind::init()':
a.cc:7:21: error: 'lint' was not declared in this scope; did you mean 'int'?
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                     ^~~~
      |                     int
a.cc:7:32: error: 'i' was not declared in this scope
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                ^
a.cc:7:36: error: 'rnk' was not declared in this scope
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:8:37: error: 'include' was not declared in this scope
    8 |                         rnk[i] = 0;#include <bits/stdc++.h>
      |                                     ^~~~~~~
a.cc:8:46: error: 'bits' was not declared in this scope
    8 |                         rnk[i] = 0;#include <bits/stdc++.h>
      |                                              ^~~~
a.cc:8:51: error: 'stdc' was not declared in this scope; did you mean 'std'?
    8 |                         rnk[i] = 0;#include <bits/stdc++.h>
      |                                                   ^~~~
      |                                                   std
a.cc:9:1: error: expected primary-expression before 'using'
    9 | using namespace std;
      | ^~~~~
a.cc:10:7: error: redeclaration of 'using lint = long long int'
   10 | using lint = long long;
      |       ^~~~
a.cc:7:21: note: '<typeprefixerror>lint' previously declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                     ^~~~
a.cc:13:9: error: 'vector' does not name a type
   13 |         vector<lint> rnk,par,num;
      |         ^~~~~~
a.cc: In constructor 'UnionFind::init()::UnionFind::UnionFind(lint)':
a.cc:14:29: error: class 'UnionFind::init()::UnionFind' does not have any field named 'rnk'
   14 |         UnionFind(lint N) : rnk(N),par(N),num(N){
      |                             ^~~
a.cc:14:36: error: class 'UnionFind::init()::UnionFind' does not have any field named 'par'
   14 |         UnionFind(lint N) : rnk(N),par(N),num(N){
      |                                    ^~~
a.cc:14:43: error: class 'UnionFind::init()::UnionFind' does not have any field named 'num'
   14 |         UnionFind(lint N) : rnk(N),par(N),num(N){
      |                                           ^~~
a.cc: In member function 'void UnionFind::init()::UnionFind::init()':
a.cc:18:36: error: use of local variable with automatic storage from containing function
   18 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:19:25: error: use of local variable with automatic storage from containing function
   19 |                         rnk[i] = 0;
      |                         ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:20:25: error: 'par' was not declared in this scope
   20 |                         par[i] = i;
      |                         ^~~
a.cc:21:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   21 |                         num[i] = 1;
      |                         ^~~
      |                         enum
a.cc: In member function 'lint UnionFind::init()::UnionFind::find(lint)':
a.cc:25:20: error: 'par' was not declared in this scope
   25 |                 if(par[x] == x) return x;
      |                    ^~~
a.cc:26:24: error: 'par' was not declared in this scope
   26 |                 return par[x] = find(par[x]);
      |                        ^~~
a.cc: In member function 'void UnionFind::init()::UnionFind::unite(lint, lint)':
a.cc:32:20: error: use of local variable with automatic storage from containing function
   32 |                 if(rnk[x] < rnk[y]){
      |                    ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:32:29: error: use of local variable with automatic storage from containing function
   32 |                 if(rnk[x] < rnk[y]){
      |                             ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:33:25: error: 'par' was not declared in this scope
   33 |                         par[x] = y;
      |                         ^~~
a.cc:34:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   34 |                         num[y] += num[x];
      |                         ^~~
      |                         enum
a.cc:37:25: error: 'par' was not declared in this scope
   37 |                         par[y] = x;
      |                         ^~~
a.cc:38:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   38 |                         num[x] += num[y];
      |                         ^~~
      |                         enum
a.cc:39:28: error: use of local variable with automatic storage from containing function
   39 |                         if(rnk[x] == rnk[y]) rnk[x]++;
      |                            ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:39:38: error: use of local variable with automatic storage from containing function
   39 |                         if(rnk[x] == rnk[y]) rnk[x]++;
      |                                      ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc:39:46: error: use of local variable with automatic storage from containing function
   39 |                         if(rnk[x] == rnk[y]) rnk[x]++;
      |                                              ^~~
a.cc:7:36: note: '<typeprefixerror>rnk' declared here
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                    ^~~
a.cc: In member function 'lint UnionFind::init()::UnionFind::size(lint)':
a.cc:46:24: error: 'num' was not declared in this scope; did you mean 'enum'?
   46 |                 return num[find(x)];
      |                        ^~~
      |                        enum
a.cc: In member function 'void UnionFind::init()':
a.cc:50:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   50 | signed main(){
      |            ^~
a.cc:50:12: note: remove parentheses to default-initialize a variable
   50 | signed main(){
      |            ^~
      |            --
a.cc:50:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:50:14: error: a function-definition is not allowed here before '{' token
   50 | signed main(){
      |              ^
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:7:51: note: to match this '{'
    7 |                 for(lint i = 0;i < rnk.size();i++){
      |                                                   ^
a.cc:65:2: error: expected '}' at end of input
   65 | }
      |  ^
a.cc:6:20: note: to match this '{'
    6 |         void init(){
      |                    ^
a.cc: At global scope:
a.cc:65:2: error: expected unqualified-id at end of input
   65 | }
      |  ^