Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llu unsigned long long
#define pb push_back
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fs(s) for(ll i=0;s[i]!='\0';i++)
#define fr(i,a,b) for(ll i=a;i>=b;i--)
#define gcd(a,b) __gcd(a,b)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define c1(x) __builtin_popcountll(x)
#define setprs(x) cout << fixed << setprecision(x);
#define endl '\n'
const ll mod=1e9 + 7;
const ll sz=2e5 + 100;
const double PI =3.14159265;
ll power(ll a, ll b, ll m = mod){if(b==0)return 1;else if(b==1)return a%m;else{ll t=power(a,b>>1,m);t=((t%m)*(t%m))%m;if(b&1)return ((t%m)*(a%m))%m;else return t%m;}}
 
//--------------------------------------------------------

int parent[sz], size[sz];

int findparent(int n){
    if(parent[n] == n){
        return n;
    }
    parent[n]=findparent(parent[n]);
    return parent[n];
}

void merge(int x, int y){
    int p1 = findparent(x);
    int p2 = findparent(y);
    if(p1 == p2)return;
    if(size[p1] > size[p2]){
        parent[p2] = p1;
        size[p1] += size[p2];
    }else{
        parent[p1] = p2;
        size[p2] += size[p1];
    }
    // cout << x << " " << y;
}

void solve()
{
    int n, m;
    cin >> n >> m;
    f(i,0,n+1)parent[i] = i;
    f(i,0,n+1)size[i] = 1;
    while(m--){
        int x,y;
        cin >> x >> y;
        merge(x, y);
    }
    int mx = 0;
    f(i,0,n){
        mx = max(mx , size[i]);
    }
    cout << mx;

} 
 
int32_t main()
{
    fastio
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void merge(int, int)':
a.cc:36:8: error: reference to 'size' is ambiguous
   36 |     if(size[p1] > size[p2]){
      |        ^~~~
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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:36:19: error: reference to 'size' is ambiguous
   36 |     if(size[p1] > size[p2]){
      |                   ^~~~
/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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:38:9: error: reference to 'size' is ambiguous
   38 |         size[p1] += size[p2];
      |         ^~~~
/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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:38:21: error: reference to 'size' is ambiguous
   38 |         size[p1] += size[p2];
      |                     ^~~~
/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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:41:9: error: reference to 'size' is ambiguous
   41 |         size[p2] += size[p1];
      |         ^~~~
/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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:41:21: error: reference to 'size' is ambiguous
   41 |         size[p2] += size[p1];
      |                     ^~~~
/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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc: In function 'void solve()':
a.cc:51:15: error: reference to 'size' is ambiguous
   51 |     f(i,0,n+1)size[i] = 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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~
a.cc:59:23: error: reference to 'size' is ambiguous
   59 |         mx = max(mx , size[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:22:17: note:                 'int size [200100]'
   22 | int parent[sz], size[sz];
      |                 ^~~~