Language: C++

#include<bits/stdc++.h>

using namespace std ;

int block[10005] ; 
int user[10005] ; 
int size[10005] ; 


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

int main () { 
	for (int i = 1 ; i <= n ; i ++ ) {
		user[i] = i ; 
		size[i] = 1 ;
	}
	int t  ; 
	int n , k , m ; 
	cin >> n >> k >> m ;
	int a , b ; 
	int rootA , rootB ; 
	for ( int i =  1 ; i <= k ; i ++ )  {
		cin >> a >> b;
		
		rootA = find(a) ; 
		rootB = find(b) ; 
		block[a]++ ; 
		block[b]++ ;  
		if ( rootA != rootB ) {
			user[rootA] = user[b] ; 
			size[rootB] += size[rootA] ;
		
		}
		
		
	}
	for (int i = 1 ; i <= m  ; i ++ )  {
		cin >> a >> b ;
		rootA = find(a) ; 
		rootB = find(b) ; 
		if ( rootA == rootB ) {
			block[a]++ ; 
			block[b]++ ; 
		}
	}
	for ( int i = 1 ; i <= n ; i ++ ) {
		cout << size[find(i)] -1 - block[i] << " " ;
	}
	cout << endl ; 
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: 'n' was not declared in this scope
   17 |         for (int i = 1 ; i <= n ; i ++ ) {
      |                               ^
a.cc:19:17: error: reference to 'size' is ambiguous
   19 |                 size[i] = 1 ;
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [10005]'
    7 | int size[10005] ;
      |     ^~~~
a.cc:35:25: error: reference to 'size' is ambiguous
   35 |                         size[rootB] += size[rootA] ;
      |                         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [10005]'
    7 | int size[10005] ;
      |     ^~~~
a.cc:35:40: error: reference to 'size' is ambiguous
   35 |                         size[rootB] += size[rootA] ;
      |                                        ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [10005]'
    7 | int size[10005] ;
      |     ^~~~
a.cc:51:25: error: reference to 'size' is ambiguous
   51 |                 cout << size[find(i)] -1 - block[i] << " " ;
      |                         ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:7:5: note:                 'int size [10005]'
    7 | int size[10005] ;
      |     ^~~~