Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <iomanip>
#include <cmath>
#include <chrono>

#define vi vector<int>
#define tests int t; cin>>t; while(t--)
#define ll long long
#define vll vector<long long>
#define srt(v) sort(v.begin(), v.end())
#define srtg(v) sort(v.begin(), v.end(), greater<int> ())
#define FOR(k, n) for(int k=0; k<n; k++)
#define pb push_back


using namespace std;
using namespace std::chrono;

char nums[10] = { '0','1','2','3','4','5','6','7','8','9' };
char alphsl[26] = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' };
const int MOD = 1000000007;
char alphs[26] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };

int visited[200001];
int size = 0;

void dfs(int a, vector<vector<int>> adj) {
    if (visited[a] == 1) return;
    visited[a] = 1;
    size++;
    for (int i = 0; i < adj[a].size(); i++) {
        dfs(adj[a][i], adj);
    }

}



void solve() {

    int n, m;
    cin >> n >> m;

    vector<vector<int>> adj(n+1);
    vector<set<int>> present(n+1);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        if (present[a].count(b) == 0) {
            adj[a].pb(b);
            adj[b].pb(a);
            present[a].insert(b);
            present[b].insert(a);
        }
    }
    int maxy = 0;
    for (int i = 1; i <= n; i++) {
        if (visited[i] == 1) {
            continue;
        }
        if (visited[i] == 0) {
            size = 0;
            dfs(i, adj);
            maxy = max(size, maxy);
        }
    }

    cout << maxy << endl;
    

}


int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);

        
        solve();


    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, std::vector<std::vector<int> >)':
a.cc:33:5: error: reference to 'size' is ambiguous
   33 |     size++;
      |     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:28:5: note:                 'int size'
   28 | int size = 0;
      |     ^~~~
a.cc: In function 'void solve()':
a.cc:65:13: error: reference to 'size' is ambiguous
   65 |             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:28:5: note:                 'int size'
   28 | int size = 0;
      |     ^~~~
a.cc:67:24: error: reference to 'size' is ambiguous
   67 |             maxy = max(size, maxy);
      |                        ^~~~
/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:28:5: note:                 'int size'
   28 | int size = 0;
      |     ^~~~