Language: C++

        #include <bits/stdc++.h>
        using namespace std;
        #define tani_nachi_ke  ios_base::sync_with_stdio(false); cin.tie(NULL);
        #define M_PI 3.14159265358979323846
        #define data data_
        #define ff first
        #define ss second
        #define pb push_back
        #define ld long double
        #define int long long
        #define print(t) cout << "Case #" << t << ": ";

        int const N=2e5+900;
        int parent[N],size[N];
        void make_set(int v)
        {
            parent[v]=v;
            size[v]=1;
        }
        int find_set(int v)
        {
            if(parent[v]==v)return v;
            else return parent[v]=find_set(parent[v]);
        }
        void set_unite(int x,int y)
        {
            int a=find_set(x);
            int b=find_set(y);
            if(a!=b)
            {
                if(size[a]<size[b])swap(a,b);
                parent[b]=a;
                size[a]+=size[b];
            }
        }

        int32_t main()
        {
            tani_nachi_ke  
            
            int n,m;
            cin >> n >> m;
            for(int i = 1; i <= n; i++)
                make_set(i);

            for(int i = 1; i <= m; i++)
            {
                int x,y;
                cin >> x >> y;
                if(find_set(x) != find_set(y))
                    set_unite(x,y);
            }

            vector<int> bin;
            for(int i = 1; i <= n; i++)
            {
                if(parent[i] == i)
                    bin.push_back(size[i]);
            }
            sort(bin.begin(), bin.end());

            int ans = 0;
            int cur = 0;
            for(int i = 0; i < bin.size(); i++)
            {
                bin[i] -= cur;
                ans += bin[i];
                cur += bin[i];
            }
            cout << ans << '\n';





           return 0;
        }
          

Compiler output:
a.cc: In function 'void make_set(long long int)':
a.cc:18:13: error: reference to 'size' is ambiguous
   18 |             size[v]=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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~
a.cc: In function 'void set_unite(long long int, long long int)':
a.cc:31:20: error: reference to 'size' is ambiguous
   31 |                 if(size[a]<size[b])swap(a,b);
      |                    ^~~~
/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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~
a.cc:31:28: error: reference to 'size' is ambiguous
   31 |                 if(size[a]<size[b])swap(a,b);
      |                            ^~~~
/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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~
a.cc:33:17: error: reference to 'size' is ambiguous
   33 |                 size[a]+=size[b];
      |                 ^~~~
/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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~
a.cc:33:26: error: reference to 'size' is ambiguous
   33 |                 size[a]+=size[b];
      |                          ^~~~
/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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~
a.cc: In function 'int32_t main()':
a.cc:58:35: error: reference to 'size' is ambiguous
   58 |                     bin.push_back(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:14:23: note:                 'long long int size [200900]'
   14 |         int parent[N],size[N];
      |                       ^~~~