Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;

#define sync std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define loopi(n) for(int i=0;i<n;i++)
#define loopj(n) for(int j=0;j<n;j++)
#define loop(a,b,c) for(int i=a;i<=b;i=i+c)

#define     deb(x)      cout<<#x<<"="<<x<<endl
#define     all(x)      (x).begin(),(x).end()
#define     reset(a)    memset(a,0,sizeof(a))
#define     sz(x)       ((int)(x.size()))
#define     pb          push_back
#define     pf          push_front
#define     pob	        pop_back
#define     pof         pop_front
#define     ins         insert
#define     F           first
#define     S           second
#define     mkp         make_pair
#define     mkt         make_tuple
#define     bitcount(x) __builtin_popcountll(x)
#define     gcd(a,b)    (__gcd(a,b))
#define     lcm(a,b)    ((a*b)/gcd(a,b))
#define PI 3.1415926535897932384626
 
const int mod = 1e9+7;
const int N=2e5+5;
//============================================//
int ans=0;
int c;
vector<int> g[N];

void DFS(int v, bool vis[])
{
	vis[v]=true;
	c++;
	for(auto x: g[v])
		if(!vis[x])
			DFS(x,vis);
}
void solve()
{
	int n,m;
	cin>>n>>m;
	set<pair<int,int>> s;
	loopi(m)
	{
		int x,y;
		cin>>x>>y;
		if(!s.count({x,y}) || !s.count({y,x}))
		{
			g[x].pb(y);
			g[y].pb(x);
		}
		s.insert({y,x});
		s.insert({x,y});
	}
	bool vis[n+1]={false};
	loop(1,n,1)
	{
		c=0;
		if(vis[i]==false)
			DFS(i,vis);
		ans=max(ans,c);
	}
	cout<<ans;
	
}
int main() 
{
	sync;

	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
		cout<<endl;
	}
}

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pll;

#define sync std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define loopi(n) for(int i=0;i<n;i++)
#define loopj(n) for(int j=0;j<n;j++)
#define loop(a,b,c) for(int i=a;i<=b;i=i+c)

#define     deb(x)      cout<<#x<<"="<<x<<endl
#define     all(x)      (x).begin(),(x).end()
#define     reset(a)    memset(a,0,sizeof(a))
#define     sz(x)       ((int)(x.size()))
#define     pb          push_back
#define     pf          push_front
#define     pob	        pop_back
#define     pof         pop_front
#define     ins         insert
#define     F           first
#define     S           second
#define     mkp         make_pair
#define     mkt         make_tuple
#define     bitcount(x) __builtin_popcountll(x)
#define     gcd(a,b)    (__gcd(a,b))
#define     lcm(a,b)    ((a*b)/gcd(a,b))
#define PI 3.1415926535897932384626
 
const int mod = 1e9+7;
const int N=2e5+5;
//============================================//
int ans=0;
int c;
vector<int> g[N];

void DFS(int v, bool vis[])
{
	vis[v]=true;
	c++;
	for(auto x: g[v])
		if(!vis[x])
			DFS(x,vis);
}
void solve()
{
	int n,m;
	cin>>n>>m;
	set<pair<int,int>> s;
	loopi(m)
	{
		int x,y;
		cin>>x>>y;
		if(!s.count({x,y}) || !s.count({y,x}))
		{
			g[x].pb(y);
			g[y].pb(x);
		}
		s.insert({y,x});
		s.insert({x,y});
	}
	bool vis[n+1]={false};
	loop(1,n,1)
	{
		c=0;
		if(vis[i]==false)
			DFS(i,vis);
		ans=max(ans,c);
	}
	cout<<ans;
	
}
int main() 
{
	sync;

	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
		cout<<endl;
	}
}



Compiler output:
a.cc:121:11: error: redefinition of 'const int mod'
  121 | const int mod = 1e9+7;
      |           ^~~
a.cc:33:11: note: 'const int mod' previously defined here
   33 | const int mod = 1e9+7;
      |           ^~~
a.cc:122:11: error: redefinition of 'const int N'
  122 | const int N=2e5+5;
      |           ^
a.cc:34:11: note: 'const int N' previously defined here
   34 | const int N=2e5+5;
      |           ^
a.cc:124:5: error: redefinition of 'int ans'
  124 | int ans=0;
      |     ^~~
a.cc:36:5: note: 'int ans' previously defined here
   36 | int ans=0;
      |     ^~~
a.cc:125:5: error: redefinition of 'int c'
  125 | int c;
      |     ^
a.cc:37:5: note: 'int c' previously declared here
   37 | int c;
      |     ^
a.cc:126:13: error: redefinition of 'std::vector<int> g [200005]'
  126 | vector<int> g[N];
      |             ^
a.cc:38:13: note: 'std::vector<int> g [200005]' previously declared here
   38 | vector<int> g[N];
      |             ^
a.cc:128:6: error: redefinition of 'void DFS(int, bool*)'
  128 | void DFS(int v, bool vis[])
      |      ^~~
a.cc:40:6: note: 'void DFS(int, bool*)' previously defined here
   40 | void DFS(int v, bool vis[])
      |      ^~~
a.cc:136:6: error: redefinition of 'void solve()'
  136 | void solve()
      |      ^~~~~
a.cc:48:6: note: 'void solve()' previously defined here
   48 | void solve()
      |      ^~~~~
a.cc:164:5: error: redefinition of 'int main()'
  164 | int main()
      |     ^~~~
a.cc:76:5: note: 'int main()' previously defined here
   76 | int main()
      |     ^~~~