Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<vector<int> > adj;
vector<int> size, visited;

void dfs(int cur, int parent) {
	visited[cur] = 1;
	size[cur] = 1;
	for (auto u : adj[cur]) {
		if (!visited[u] && u != parent) {
			dfs(u, cur);
			size[cur] += size[u];
		}
	}
	return ;
}

void solve() {
	int n, m; cin >> n >> m;
	adj.resize(n);
	size.resize(n, 0);
	visited.resize(n, 0);
	map<pair<int, int> , bool> mapp;
	for (int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		a--; b--;
		if (a > b)swap(a, b);
		if (mapp[ {a, b}])continue;
		adj[a].push_back(b);
		adj[b].push_back(a);
		mapp[ {a, b}] = 1;
	}
	for (int i = 0; i < n; i++)if (!visited[i])dfs(i, -1);
	int ans = *max_element(size.begin(), size.end());
	cout << ans;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// int t; cin >> t;
	// while (t--)
	solve();

}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:9:9: error: reference to 'size' is ambiguous
    9 |         size[cur] = 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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~
a.cc:13:25: error: reference to 'size' is ambiguous
   13 |                         size[cur] += size[u];
      |                         ^~~~
/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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~
a.cc:13:38: error: reference to 'size' is ambiguous
   13 |                         size[cur] += size[u];
      |                                      ^~~~
/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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~
a.cc: In function 'void solve()':
a.cc:22:9: error: reference to 'size' is ambiguous
   22 |         size.resize(n, 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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~
a.cc:35:32: error: reference to 'size' is ambiguous
   35 |         int ans = *max_element(size.begin(), size.end());
      |                                ^~~~
/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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~
a.cc:35:46: error: reference to 'size' is ambiguous
   35 |         int ans = *max_element(size.begin(), size.end());
      |                                              ^~~~
/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:5:13: note:                 'std::vector<int> size'
    5 | vector<int> size, visited;
      |             ^~~~