Language: C++

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

#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"
#define watch3(x,y,z) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<" and "<<(#z)<<" is "<<(z)<<"\n"

#define ll long long
#define ff first
#define ss second
#define null NULL
#define all(c) (c).begin(),(c).end()
#define nl "\n"

#define ld long double
#define eb emplace_back
#define pb push_back
#define pf push_front
#define mod 1000000007

typedef vector<ll> vl;
typedef vector< vl > vvl;
typedef pair< ll, ll> pll;
typedef map< ll, ll> mll;

#define pie_value 3.14159265358979323846

unordered_map<ll, ll> vis;
map<ll, set<ll>> mp;
ll size;

void dfs(ll i) {
	vis[i] = 1;
	size++;

	for (auto child : mp[i]) {
		if (!vis[child])
			dfs(child);
	}
}

int main() {

	// Use ctrl+shift+b ( second option )
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt" , "w" , stderr);
#endif

	ll n, m;
	cin >> n >> m;

	vis.clear();
	mp.clear();

	for (ll i = 1; i <= m; i++) {
		ll a, b;
		cin >> a >> b;

		mp[a].insert(b);
		mp[b].insert(a);
	}

	ll c = 0;
	ll max_size = 0;
	for (ll i = 1; i <= n; i++) {
		size = 0;
		if (!vis[i]) {
			dfs(i);
			c++;
			max_size = max(max_size , size);
		}
	}

	cout << max_size << nl;

	return 0;
}


Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:34:9: error: reference to 'size' is ambiguous
   34 |         size++;
      |         ^~~~
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:30:4: note:                 'long long int size'
   30 | ll size;
      |    ^~~~
a.cc: In function 'int main()':
a.cc:72:17: error: reference to 'size' is ambiguous
   72 |                 size = 0;
      |                 ^~~~
/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:30:4: note:                 'long long int size'
   30 | ll size;
      |    ^~~~
a.cc:76:51: error: reference to 'size' is ambiguous
   76 |                         max_size = max(max_size , size);
      |                                                   ^~~~
/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:30:4: note:                 'long long int size'
   30 | ll size;
      |    ^~~~