Language: C++

//Patwari26
//#include template<t> as mine
#include<bits/stdc++.h>
using namespace std;

#define ll          long long
#define pb          push_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
vi link(N),size(N,1);
ll find(ll x)
{
    while(x!=link[x]) x=link[x];
    return x;
}
bool same(ll i,ll j)
    {return find(i)==find(j);}
void unite(ll a,ll b)
{
    a=find(a);
    b=find(b);
    if(size[a]<size[b]) swap(a,b);
    size[a]+=size[b];
    link[b]=a;
}
void solve(){
    ll n,m,x,y;
    cin>>n>>m;
    rep(i,1,n) link[i]=i;
    rep(i,1,m){
        cin>>x>>y;
        if(!same(x,y)) unite(x,y);
    }
    ll maxx=0;
    ll cc[n+1];
    memset(cc,0,sizeof(cc));
    rep(i,1,n) cc[find(i)]++;
    rep(i,1,n) maxx=max(maxx,cc[i]);
    cout<<maxx<<endl;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    // time
    return 0;
}

Compiler output:
a.cc:25:10: error: 'std::vector<long long int> link' redeclared as different kind of entity
   25 | vi link(N),size(N,1);
      |          ^
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:3:
/usr/include/unistd.h:819:12: note: previous declaration 'int link(const char*, const char*)'
  819 | extern int link (const char *__from, const char *__to)
      |            ^~~~
a.cc: In function 'long long int find(long long int)':
a.cc:28:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |     while(x!=link[x]) x=link[x];
      |                    ^
a.cc:28:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   28 |     while(x!=link[x]) x=link[x];
      |            ^
a.cc:28:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |     while(x!=link[x]) x=link[x];
      |                               ^
a.cc:28:31: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'long long int' [-fpermissive]
   28 |     while(x!=link[x]) x=link[x];
      |                         ~~~~~~^
      |                               |
      |                               int (*)(const char*, const char*) noexcept
a.cc: In function 'void unite(long long int, long long int)':
a.cc:37:8: error: reference to 'size' is ambiguous
   37 |     if(size[a]<size[b]) swap(a,b);
      |        ^~~~
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:
/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:25:12: note:                 'std::vector<long long int> size'
   25 | vi link(N),size(N,1);
      |            ^~~~
a.cc:37:16: error: reference to 'size' is ambiguous
   37 |     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:25:12: note:                 'std::vector<long long int> size'
   25 | vi link(N),size(N,1);
      |            ^~~~
a.cc:38:5: error: reference to 'size' is ambiguous
   38 |     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:25:12: note:                 'std::vector<long long int> size'
   25 | vi link(N),size(N,1);
      |            ^~~~
a.cc:38:14: error: reference to 'size' is ambiguous
   38 |     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:25:12: note:                 'std::vector<long long int> size'
   25 | vi link(N),size(N,1);
      |            ^~~~
a.cc:39:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   39 |     link[b]=a;
      |           ^
a.cc:39:12: error: assignment of read-only location '*(link + ((sizetype)b))'
   39 |     link[b]=a;
      |     ~~~~~~~^~
a.cc: In function 'void solve()':
a.cc:44:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |     rep(i,1,n) link[i]=i;
      |                      ^
a.cc:44:23: error: assignment of read-only location '*(link + ((sizetype)i))'
   44 |     rep(i,1,n) link[i]=i;
      |                ~~~~~~~^~