Language: C++

/******
	~site:    atcoder.jp
	~user:    Turkhuu
	~problem: AtCoder Beginner Contest 177 - D (abc177_d)
** **/

#include<bits/stdc++.h>

#define FFOR(i,s,e,k) for(int i=s;(k==1?i<=e:i>=e);i+=k)
#define FOR(i,n) FFOR(i,0,n-1,1)
#define FORR(i,s,e) FFOR(i,s,e,1)
#define ll long long
#define PQ priority_queue
#define pb push_back
#define ppb pop_back()
#define pp push
#define MIN(v) *min_element(v.begin(),v.end())
#define MAX(v) *max_element(v.begin(),v.end())
#define SORT(v) sort(v.begin(),v.end())
#define TROS(v) sort(v.rbegin(),v.rend())
#define CNT(v,x) count(v.begin(),v.end(),x)
#define FIND(v,x) find(v.begin(),v.end(),x)

using namespace std;

int link[200001],size[200001];

int find(int x){
	while(x!=link[x]) x=link[x];
	return x;
}

void unite(int a,int b){
	a=find(a);
	b=find(b);
	if(size[a]<size[b]){
		int temp=a;
		a=b;
		b=temp;
	}
	size[a]+=size[b];
	link[b]=a;
}

bool same(int a,int b){
	return find(a)==find(b);
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n,m;
	cin>>n>>m;
	FOR(i,n) {link[i]=i; size[i]=1;}
	
	FOR(i,m){
		int a,b;
		cin>>a>>b;
		if(same(a,b)) continue;
		unite(a,b);
	}
	
	int ans=0;
	FOR(i,n) ans=max(ans,size[i]);
	cout<<ans;
}

Compiler output:
a.cc:26:16: error: 'int link [200001]' redeclared as different kind of entity
   26 | int link[200001],size[200001];
      |                ^
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:7:
/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 'int find(int)':
a.cc:29:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |         while(x!=link[x]) x=link[x];
      |                        ^
a.cc:29:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |         while(x!=link[x]) x=link[x];
      |               ~^~~~~~~~~
a.cc:29:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |         while(x!=link[x]) x=link[x];
      |                                   ^
a.cc:29:35: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to 'int' [-fpermissive]
   29 |         while(x!=link[x]) x=link[x];
      |                             ~~~~~~^
      |                                   |
      |                                   int (*)(const char*, const char*) noexcept
a.cc: In function 'void unite(int, int)':
a.cc:36:12: error: reference to 'size' is ambiguous
   36 |         if(size[a]<size[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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~
a.cc:36:20: error: reference to 'size' is ambiguous
   36 |         if(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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~
a.cc:41:9: error: reference to 'size' is ambiguous
   41 |         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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~
a.cc:41:18: error: reference to 'size' is ambiguous
   41 |         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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~
a.cc:42:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   42 |         link[b]=a;
      |               ^
a.cc:42:16: error: assignment of read-only location '*(link + ((sizetype)b))'
   42 |         link[b]=a;
      |         ~~~~~~~^~
a.cc: In function 'int main()':
a.cc:55:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   55 |         FOR(i,n) {link[i]=i; size[i]=1;}
      |                         ^
a.cc:55:26: error: assignment of read-only location '*(link + ((sizetype)i))'
   55 |         FOR(i,n) {link[i]=i; size[i]=1;}
      |                   ~~~~~~~^~
a.cc:55:30: error: reference to 'size' is ambiguous
   55 |         FOR(i,n) {link[i]=i; 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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~
a.cc:65:30: error: reference to 'size' is ambiguous
   65 |         FOR(i,n) ans=max(ans,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:26:18: note:                 'int size [200001]'
   26 | int link[200001],size[200001];
      |                  ^~~~