Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define s(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)

vector<int> adj[200010];
bool vis[200010];

int size = 0;
void DFS(int u)
{
    size++;
    vis[u] = true;
    for (int i = 0; i < adj[u].size(); i++)
    {
        if (vis[adj[u][i]] == false)
        {
            //        size++;
            DFS(adj[u][i]);
        }
    }
}

int main()
{
#ifdef WIN32
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

#ifndef WIN32
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#endif
    int n, m, x, y;
    cin >> n >> m;
    //s(size, 1);

    s(vis, false);
    // int ans = 0;

    for (int i = 0; i < m; i++)
    {
        cin >> x >> y;
        // x--;
        //y--;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    int ans = INT_MIN;
    for (int i = 1; i <= n; i++)
    {
        size = 0;
        if (vis[i] == false)
        {
            //size++;
            DFS(i);
        }
        ans = max(ans, size);
    }
    cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'void DFS(int)':
a.cc:14:5: error: reference to 'size' is ambiguous
   14 |     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:11:5: note:                 'int size'
   11 | int size = 0;
      |     ^~~~
a.cc: In function 'int main()':
a.cc:56:9: error: reference to 'size' is ambiguous
   56 |         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:11:5: note:                 'int size'
   11 | int size = 0;
      |     ^~~~
a.cc:62:24: error: reference to 'size' is ambiguous
   62 |         ans = max(ans, 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:11:5: note:                 'int size'
   11 | int size = 0;
      |     ^~~~