criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*; 
class Main { 
    // A user define class to represent a graph. 
    // A graph is an array of adjacency lists. 
    // Size of array will be V (number of vertices 
    // in graph) 
    int V; 
    LinkedList<Integer>[] adjListArray; 
      
    // constructor 
    Graph(int V) { 
        this.V = V; 
        // define the size of array as 
        // number of vertices 
        adjListArray = new LinkedList[V]; 
  
        // Create a new list for each vertex 
        // such that adjacent nodes can be stored 
  
        for(int i = 0; i < V ; i++){ 
            adjListArray[i] = new LinkedList<Integer>(); 
        } 
    } 
      
    // Adds an edge to an undirected graph 
    void addEdge( int src, int dest) { 
        // Add an edge from src to dest. 
        adjListArray[src].add(dest); 
  
        // Since graph is undirected, add an edge from dest 
        // to src also 
        adjListArray[dest].add(src); 
    } 
      
    int DFSUtil(int v, boolean[] visited) { 
        // Mark the current node as visited and print it 
        visited[v] = true; 
        System.out.print(v+" "); 
        int m = 1;
        // Recur for all the vertices 
        // adjacent to this vertex 
        for (int x : adjListArray[v]) { 
            if(!visited[x]) m = DFSUtil(x,visited); 
        } 
        return m + 1;
    } 
    void connectedComponents() { 
        // Mark all the vertices as not visited 
        boolean[] visited = new boolean[V]; 
        int max = 0;
        for(int v = 0; v < V; ++v) { 
            if(!visited[v]) { 
                // print all reachable vertices 
                // from v 
                max = Math.max(max, DFSUtil(v,visited)); 
            } 
        } 
        System.out.println(max);
    } 
      
      
    // Driver program to test above 
    public static void main(String[] args){ 
        // Create a graph given in the above diagram 
        HashSet<ArrayList<Integer>> check = new HashSet(); 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Graph g = new Graph(n); // 5 vertices numbered from 0 to 4  
        int m = in.nextInt();

        while(m-- > 0){
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            ArrayList<Integer> temp = new ArrayList();
            if(a > b){
                int k = a; 
                a = b;
                b = k;
            }
            temp.add(a); temp.add(b);
            if(!check.contains(temp))
                g.addEdge(a, b);
        }
        g.connectedComponents(); 
    } 
}     

Compiler output:
Main.java:11: error: invalid method declaration; return type required
    Graph(int V) { 
    ^
1 error
Language: C++

#include <iostream>
#include<bits/stdc++.h>

using namespace std;

#define pb(x) push_back(x)
#define fr(i, n) for(int i=0; i<n; i++)
#define ll long long

typedef vector<int> vi;
typedef vector<long long> vl;

void DFS(vector<bool> vis, int index, int &cur)
{
    vis[index] = true;
    queue<int> q;
    q.push(index);
    while(!q.empty())
    {
        cur++;
        int v = q.front();
        q.pop();
        for(int i=0; i<adj[v].size(); i++)
        {
            if(!vis[adj[v][i]])
            {
                vis[adj[v][i]] = true;
                q.push(adj[v][i]);
            }
        }
    }
}
vector<int> A[200000];
int main() {
    int n, m;
    cin>>n>>m;
    fr(i,m)
    {
        int a, b;
        cin>>a>>b;
        A[a-1].pb(b-1);
        A[b-1].pb(a-1);
    }
    vector<bool> vis(n, false);
    bool flag = true;
    int maxi = INT_MIN;
    bool flag = true;
    
    while(flag)
    {
        flag= false;
        for(int i=0; i<n; i++)
        {
            int cur = 0;
            if(!vis[i])
            {
                DFS(vis, i, cur); 
                break;
            }
        }
        maxi = max(maxi, cur);
        fr(i, n)
        {
            if(!vis[i])
                flag = true;
        }
    }
    cout<<maxi;
	return 0;
}

Compiler output:
a.cc: In function 'void DFS(std::vector<bool>, int, int&)':
a.cc:23:24: error: 'adj' was not declared in this scope
   23 |         for(int i=0; i<adj[v].size(); i++)
      |                        ^~~
a.cc: In function 'int main()':
a.cc:47:10: error: redeclaration of 'bool flag'
   47 |     bool flag = true;
      |          ^~~~
a.cc:45:10: note: 'bool flag' previously declared here
   45 |     bool flag = true;
      |          ^~~~
a.cc:61:26: error: 'cur' was not declared in this scope
   61 |         maxi = max(maxi, cur);
      |                          ^~~
Language: C++

#include <bits/stc++.h>
using namespace std;
typedef long long ll;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST

class UnionFind {
private:
    vector<ll> data;
    vector<ll> tree_size;

public:
    UnionFind(ll n) {
        data = vector<ll>(n);
        tree_size = vector<ll>(n, 1);
        for (ll i = 0; i < n; ++i)
            data[i] = i;
        
    }

    ll root(ll a) {
        if (data[a] == a) return a;
        else return data[a] = root(data[a]);
    }

    void unite(ll a, ll b) {
        ll root_a = root(a);
        ll root_b = root(b);
        if (root_a == root_b)
            return;
        else {
            tree_size[root_b] += tree_size[root_a];
            tree_size[root_a] = 0;
            data[root_a] = root_b;
            return;
        }
        return;
    }
    ll get_tree_size(ll a)
    {
        return tree_size[root(a)];
    }
};

int main() {
    
    long N, M;
    cin >> N >> M;
    vector<ll> A(M), B(M);
    
    UnionFind uf = UnionFind(N);
    for(size_t i=0;i<M; i++)
    {
        cin >> A[i] >> B[i];
        uf.unite(A[i]-1, B[i]-1);
    }
    ll max_size=0;
    for(size_t i=0;i<N; i++)
        max_size = max(max_size, ll(uf.get_tree_size(i)));

    
    cout << max_size << endl;

    return 0;
}


Compiler output:
a.cc:1:10: fatal error: bits/stc++.h: No such file or directory
    1 | #include <bits/stc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include <stdio.h>
#include<algorithm>
#include<cstring>
#include <string>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>
#include<bits/stdc++.h>
#include <set>
#define ll   long long
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define inf 0x3f3f3f3f
#define pi 3.1415926535898
using namespace std;
const int N=2e5+10;
const int mod=1e9+7;
ll f[N+1];
ll b[N+1];
ll finds(int x)
{
    if(x!=f[x])
    {
        f[x]=finds(f[x])
        return  f[x];
    }
    return x;
}
void uni(int x,int y)
{

    int x1=finds(x);
    int y1=finds(y);
    int a=min(x1,y1);
    int b=max(x1,y1);
    f[b]=f[a];

}
int main()
{
    for(int i=1; i<=N; i++)
    {
        f[i]=i;
    }
    int n,m;
    cin>>n>>m;
    for(int i=0; i<m; i++)
    {
        int x,y;
        cin>>x>>y;
        uni(x,y);
    }
    ll maxs=-99999;
    for(int i=1; i<=n; i++)
    {
        b[f[i]]++;
    }
    for(int i=1; i<=n; i++)
    {
        maxs=max(maxs,b[i]);
    }
    cout<<maxs<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'long long int finds(int)':
a.cc:27:25: error: expected ';' before 'return'
   27 |         f[x]=finds(f[x])
      |                         ^
      |                         ;
   28 |         return  f[x];
      |         ~~~~~~
Language: C++


#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define int ll
#define vi vector<int>
#define vb vector<bool>
#define vvb vector<vb >
#define pii pair<int,int>
#define ss second
#define ff first
#define vpii vector<pii>
#define vvi vector<vi >
#define vs vector<string>
#define vvs vector<vs >
#define pqi priority_queue <int>
#define minpqi priority_queue <int, vector<int>, greater<int> >
#define all(x) x.begin(),x.end()
#define mii map<int,int>
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define per1(i,n) for(ll i=n;i>0;i--)
#define repeat(i,start,n) for(ll i=start;i<n;i++)
#define inp(arr,n) ll arr[n];rep(i,n){ cin>>arr[i];}
#define inp1(arr,n) ll arr[n+1];rep1(i,n){ cin>>arr[i];}
#define inp2d(arr,n,m) ll arr[n][m];rep(i,n)rep(j,m)cin>>arr[i][j];
#define inpg(adj,m) rep(i,m){int a,b;cin>>a>>b;adj[a].pb(b);adj[b].pb(a);}
#define print(a,n) for(ll i=0;i<n;i++){ cout<<a[i]<<" ";}
#define print1(a,n) for(ll i=1;i<=n;i++){ cout<<a[i]<<endl;}
#define mod 1000000007
#define maxx 1000000000000000000
#define PI 3.141592653589793238462643383279
#define mmax(a,b,c) max(a,max(b,c))
#define mmin(a,b,c) min(a,min(b,c))
#define init(arr,a) memset(arr,a,sizeof(arr))
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element

//------------------------------------Code Starts here------------------------------------//

vi v[200001];
int ans,sz[200001];
void dfs(int node,int par,int *visit)
{	ans++;
	visit[node]=1;
	//sz[node]=1;
	for(int i=0;i<(int)v[node].size();i++)
	{int child=v[node][i];
		if(child!=par)
			{ dfs(child,node);
			//sz[node]+=sz[it];
			}
	}
	//ans++;

}
signed main()
{
	int visit[200001];
	int n,m;
	set<int>s;
	cin>>n>>m;
	for1(i,n)visit[i]=0;
	for0(i,m)
	{
		int x,y;
		cin>>x>>y;
		int sz1=s.size();
		s.insert(x);
		s.insert(y);
		if((int)s.size()>sz1)
		{v[x].pb(y);
		v[y].pb(x);}
	}int sum=0;

	int cnt=0;
	for1(i,n)
	{
		if(visit[i]==0)
		{dfs(i,-1,visit);cnt=max(ans,cnt);ans=0;}
	}
	cout<<cnt;
}


Compiler output:
a.cc: In function 'void dfs(long long int, long long int, long long int*)':
a.cc:59:30: error: too few arguments to function 'void dfs(long long int, long long int, long long int*)'
   59 |                         { dfs(child,node);
      |                           ~~~^~~~~~~~~~~~
a.cc:52:6: note: declared here
   52 | void dfs(int node,int par,int *visit)
      |      ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
#include <set>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST

class UnionFind
{
private:
    vector<ll> data;
    vector<ll> tree_size;

public:
    UnionFind(ll n)
    {
        data = vector<ll>(n);
        tree_size = vector<ll>(n, 1);
        for (ll i = 0; i < n; ++i)
        {
            data[i] = i;
        }
    }

    ll root(ll a)
    {
        if (data[a] == a) return a;
        else return data[a] = root(data[a]);
    }

    void unite(ll a, ll b)
    {
        ll root_a = root(a);
        ll root_b = root(b);
        if (root_a == root_b)
            return;
        else
        {
            tree_size[root_b] += tree_size[root_a];
            tree_size[root_a] = 0;
            data[root_a] = root_b;
            return;
        }
        return;
    }
    ll get_tree_size(ll a)
    {
        return tree_size[root(a)];
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long N, M;
    cin >> N >> M;
    //vector<ll> A(M), B(M);
    //vector<set<ll>> friends(N);
    UnionFind uf = UnionFind(N);
    for(size_t i=0;i<M; i++)
    {
        cin >> A[i] >> B[i];
        //friends[A[i]-1].insert(B[i]-1);
        //friends[B[i]-1].insert(A[i]-1);
        uf.unite(A[i]-1, B[i]-1);
    }
    ll max_size=0;
    for(size_t i=0;i<N; i++)
    {
        //cerr << i << ":" << uf.get_tree_size(i) << endl;
        max_size = max(max_size, ll(uf.get_tree_size(i)));
    }
    /*
    for(size_t ind=0;ind<N;ind++)
    {
        //cerr << ind+1 << ":";
        for(auto i: friends[ind])
        {
            friends[ind].insert(friends[i].begin(), friends[i].end());
            friends[ind].erase(ind);
        }
        for(auto i: friends[ind])
        {
            cerr << i+1 << " ";
        }
        cerr << endl;
        //max_size = max(max_size, ll(friends[ind].size()));
    }
    */
    cout << max_size << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:16: error: 'A' was not declared in this scope
   80 |         cin >> A[i] >> B[i];
      |                ^
a.cc:80:24: error: 'B' was not declared in this scope
   80 |         cin >> A[i] >> B[i];
      |                        ^
Language: C++

#include <cstdio>
int n,m,u,v,ans=1,fa[200005],sz[200005];
int get(int x){return (fa[x]==x?fa[x]:fa[x]=get(fa[x]);}
int max(int x,int y){return x>y?x:y;}
void merge(int x,int y){
x=get(x);
y=get(y);
sz[x]+=sz[y];
ans=max(sz[x],ans);
fa[y]=x;
}
int main(){
scanf("%d%d",&n,&m);
for(int i=1; i<=n; i++) fa[i]=i,sz[i]=1;
while(m--){
scanf("%d%d",&u,&v);
merge(u,v);
}
printf("%d",ans);
}

Compiler output:
a.cc: In function 'int get(int)':
a.cc:3:55: error: expected ')' before ';' token
    3 | int get(int x){return (fa[x]==x?fa[x]:fa[x]=get(fa[x]);}
      |                       ~                               ^
      |                                                       )
Language: C

#include<stdio.h>
#include<string.h>
int main(){
 	int b,c,i,j,n,m;	
  	int ans = 0;
  	int a[200001] = {0};
 
  scanf("%d %d",&n,&m);
  for(i=0;i<n;i++){
   a[i] = 1; 
  }
  for(i=0;i<m;i++){
   scanf("%d %d",&b,&c);
    if(b<c){
      if(c[i]==0){
        b[i]=0;
      }else{
        c[i]=0;
      }
    }else{
      if(b[i]==0){
       c[i]=0; 
      }else{
       b[i]=0; 
      }
    }
    
    
  }
  for(i=0;i<n;i++){
   ans+=a[i]; 
  }
  printf("%d\n",ans);
  return 0;
}






Compiler output:
main.c: In function 'main':
main.c:15:11: error: subscripted value is neither array nor pointer nor vector
   15 |       if(c[i]==0){
      |           ^
main.c:16:10: error: subscripted value is neither array nor pointer nor vector
   16 |         b[i]=0;
      |          ^
main.c:18:10: error: subscripted value is neither array nor pointer nor vector
   18 |         c[i]=0;
      |          ^
main.c:21:11: error: subscripted value is neither array nor pointer nor vector
   21 |       if(b[i]==0){
      |           ^
main.c:22:9: error: subscripted value is neither array nor pointer nor vector
   22 |        c[i]=0;
      |         ^
main.c:24:9: error: subscripted value is neither array nor pointer nor vector
   24 |        b[i]=0;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define ff first
#define ss second
#define forr(i,a,n) for(ll i=a;i<n;i++)
#define ford(i,a,n) for(ll i=n-1;i>=a;i--)
#define all(v) v.begin(),v.end()
#define testc  ll ts;\
               cin>>ts;\
               while(ts--)
#define arn ll n;\
            cin>>n;\
            ll a[n];\
            forr(i,0,n)cin>>a[i];\
               
#define arr(a,n) ll a[n];\
                 forr(i,0,n)cin>>a[i];\
 
#define sss <<" "<<
#define nnn <<"\n"
#define nl cout<<"\n";
#define prtitr(v) for(auto itr=v.begin(); itr!=v.end() ; itr++)cout<<*itr<<" ";
#define fitr(v) for(auto itr=v.begin(); itr!=v.end() ; itr++)
using namespace std;
ll M=1e9+7;
ll cdiv(ll a,ll b){
    return (a%b==0)?a/b:a/b+1;
}
ll myMod(ll a, ll b){
    ll r = a % b;
    return r < 0 ? r + b : r;
}
ll ModPow(ll a,ll b,ll M)
{
    if(M==1)return 0;
    a%=M;
    ll ans=1,t=1;
    while(t>0&&t<=b)
    {
        if(t&b)
        {
            ans*=a;
            ans%=M;
        }
        t<<=1;
        a*=a;
        a%=M;
    }
    return ans;
}

ll m[200001];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,m1;
    cin>>n>>m1;
    if(m1==0){
        cout<<1;
        return 0;
    }
    vector<vector<ll>> v;
    
    memset(m,0,sizeof(ll)*200001)
    ll curr=1;
    forr(i,0,m1){
        ll a,b;
        cin>>a>>b;
        if(m[a]==0 && m[b]==0){
            vector<ll> s;
            s.push_back(a);
            s.push_back(b);
            v.emplace_back(s);
            m[a]=curr,m[b]=curr;
            curr++;
        }else if(m[a]==0){
            v[m[b]-1].push_back(a);
            m[a]=m[b];
        }else if(m[b]==0){
            v[m[a]-1].push_back(b);
            m[b]=m[a];
        }
    }
    ll mx=-1;
    forr(i,0,v.size()){
        mx=max(mx,(ll)v[i].size());
    }
    cout<<mx;
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:66:34: error: expected ';' before 'long'
   66 |     memset(m,0,sizeof(ll)*200001)
      |                                  ^
      |                                  ;
a.cc:76:18: error: 'curr' was not declared in this scope
   76 |             m[a]=curr,m[b]=curr;
      |                  ^~~~
Language: C++

#include <cstdio>
int n,m,u,v,ans=1,fa[200005],sz[200005];
int get(int x){return (fa[x]==x?fa[x]:fa[x]=get(fa[x]);}
void merge(int x,int y){
x=get(x);
y=get(y);
sz[x]+=sz[y];
ans=max(sz[x],ans);
fa[y]=x;
}
int main(){
scanf("%d%d",&n,&m);
for(int i=1; i<=n; i++) fa[i]=i,sz[i]=1;
while(m--){
scanf("%d%d",&u,&v);
merge(u,v);
}
printf("%d",ans);
}

Compiler output:
a.cc: In function 'int get(int)':
a.cc:3:55: error: expected ')' before ';' token
    3 | int get(int x){return (fa[x]==x?fa[x]:fa[x]=get(fa[x]);}
      |                       ~                               ^
      |                                                       )
a.cc: In function 'void merge(int, int)':
a.cc:8:5: error: 'max' was not declared in this scope
    8 | ans=max(sz[x],ans);
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

vector<set<int>> to;
vector<bool> seen;
vector<int> size;
int cnt;

void dfs(int i) {
  cnt++;
  seen[i] = true;
  for (auto d : to[i]) {
    if (seen[d]) continue;
    dfs(d);
  }
}


int main(){
  int n, m;
  cin >> n >> m;
  to.resize(n);
  int ans = 0;
  seen.assign(n,false);
  size.resize(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].insert(b);
    to[b].insert(a);
  }
  cnt = 0;
  rep(i,n) {
    if (seen[i]) continue;
    dfs(i);
    size[i] = cnt;
    cnt = 0;
  }
  rep(i,n) ans = max(ans, size[i]);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: reference to 'size' is ambiguous
   28 |   size.resize(n);
      |   ^~~~
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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc:40:5: error: reference to 'size' is ambiguous
   40 |     size[i] = cnt;
      |     ^~~~
/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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
a.cc:43:27: error: reference to 'size' is ambiguous
   43 |   rep(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:9:13: note:                 'std::vector<int> size'
    9 | vector<int> size;
      |             ^~~~
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();
    Integer[][] data=new Integer[2][M];
    List<List<Integer>> friends=new ArrayList<>();
    int res1=-1;
	int res2=-1;
    for(int i=0;i<M;i++){
     String[] lineData=sc.nextLine().split(" ");
	 data[0][i]=Integer.parseInt(lineData[0]);
     data[1][i]=Integer.parseInt(lineData[1]);
	 res1=res2=-1;     
     for(int j=0;j<friends.size();j++){
       if(friends.get(j).contains(data[0][i])){
         res1=j;
       }
       if(friends.get(j).contains(data[0][i])){
         res2=j;
       }
     }
     if(res1!=-1 && res2==-1){
       friends.get(res1).add(data[1][i]);
     }else if(res1==-1 && res2!=-1){
       friends.get(res2).add(data[0][i]);
     }else if(res1!=-1 && res2!=-1){
       friends.get(res1).addAll(friends.get(res2));
       friends.remove(res2);
     }else{
		List c=new ArratList<Integer>();
       c.add(data[0][i]);
       c.add(data[1][i]);
       friends.add(c);
              
     }
    }
    int biggest=0;
	for(int i=0;i<friends.size();i++){
      if(biggest<friends.get(i).size()){
        biggest=friends.get(i).size();
      }
    }
    System.out.println(biggest);
  }
}

Compiler output:
Main.java:33: error: cannot find symbol
		List c=new ArratList<Integer>();
		           ^
  symbol:   class ArratList
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();
    Integer[][] data=new Integer[2][M];
    List<List<Integer>> friends=new ArrayList<>();
    int res1=-1;
	int res2=-1;
    for(int i=0;i<M;i++){
     String[] lineData=sc.nextLine().split(" ");
	 data[0][i]=Integer.parseInt(lineData[0]);
     data[1][i]=Integer.parseInt(lineData[1]);
	 res1=res2=-1;     
     for(int j=0;j<friends.size();j++){
       if(friends.get(j).contains(data[0][i])){
         res1=j;
       }
       if(friends.get(j).contains(data[0][i])){
         res2=j;
       }
     }
     if(res1!=-1 && res2==-1){
       friends.get(res1).add(data[1][i]);
     }else if(res1==-1 && res2!=-1){
       friends.get(res2).add(data[0][i]);
     }else if(res1!=-1 && res2!=-1){
       friends.get(res1).addAll(friends.get(res2));
       friends.remove(res2);
     }else{
       friends.add(new ArrayList<Integer>(){
    {
        add(data[0][i]);
        add(data[1][i]);
        
    });
              
     }
    }
    int biggest=0;
	for(int i=0;i<friends.size();i++){
      if(biggest<friends.get(i).size()){
        biggest=friends.get(i).size();
      }
    }
    System.out.println(biggest);
  }
}

Compiler output:
Main.java:38: error: illegal start of type
    });
     ^
Main.java:40: error: ')' or ',' expected
     }
      ^
Main.java:50: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    int M=sc.nextInt();
    Integer[][] data=new Integer[2][M];
    List<List<Integer>> friends=new ArrayList<>();
    int res1=-1;
	int res2=-1;
    for(int i=0;i<M;i++){
     String[] lineData=sc.nextLine().split(" ");
	 data[0][i]=Integer.parseInt(lineData[0]);
     data[1][i]=Integer.parseInt(lineData[1]);
	 res1=res2=-1;     
     for(int j=0;j<friends.size();j++){
       if(friends.get(j).contains(data[0][i])){
         res1=j;
       }
       if(friends.get(j).contains(data[0][i])){
         res2=j;
       }
     }
     if(res1!=-1 && res2==-1){
       friends.get(res1).add(data[1][i]);
     }else if(res1==-1 && res2!=-1){
       friends.get(res2).add(data[0][i]);
     }else if(res1!=-1 && res2!=-1){
       friends.get(res1).addAll(friends.get(res2));
       friends.remove(res2);
     }else{
       friends.add((new ArrayList<Integer>()).add(data[0][i]).add(data[1][i]));
             
     }
    }
    int biggest=0;
	for(int i=0;i<friends.size();i++){
      if(biggest<friends.get(i).size()){
        biggest=friends.get(i).size();
      }
    }
    System.out.println(biggest);
  }
}

Compiler output:
Main.java:33: error: boolean cannot be dereferenced
       friends.add((new ArrayList<Integer>()).add(data[0][i]).add(data[1][i]));
                                                             ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.next();
    int M=sc.next();
    Integer[][] data=new Integer[2][M];
    List<List<Integer>> friends=new ArrayList<>();
    int res1=-1;
	int res2=-1;
    for(int i=0;i<M;i++){
     String[] lineData=sc.nextLine().split(" ");
	 data[0][i]=Integer.parseInt(lineData[0]);
     data[1][i]=Integer.parseInt(lineData[1]);
	 res1=res2=-1;     
     for(int j=0;j<friends.size();j++){
       if(friends.get(j).contains(data[0][i])){
         res1=j;
       }
       if(friends.get(j).contains(data[0][i])){
         res2=j;
       }
     }
     if(res1!=-1 && res2==-1){
       friends.get(res1).add(data[1][i]);
     }else if(res1==-1 && res2!=-1){
       friends.get(res2).add(data[0][i]);
     }else if(res1!=-1 && res2!=-1){
       friends.get(res1).addAll(friends.get(res2));
       friends.remove(res2);
     }else{
       friends.add((new ArrayList<Integer>()).add(data[0][i]).add(data[1][i]));
             
     }
    }
    int biggest=0;
	for(int i=0;i<friends.size();i++){
      if(biggest<friends.get(i).size()){
        biggest=friends.get(i).size();
      }
    }
    System.out.println(biggest);
  }
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to int
    int N=sc.next();
                 ^
Main.java:7: error: incompatible types: String cannot be converted to int
    int M=sc.next();
                 ^
Main.java:33: error: boolean cannot be dereferenced
       friends.add((new ArrayList<Integer>()).add(data[0][i]).add(data[1][i]));
                                                             ^
3 errors
Language: C++

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

const int N = 200010;
int p[N] , size[N] , n , m , ans;

int find(int x)
{
	return p[x] == x ? x : p[x] = find(p[x]);
}

int main()
{
	scanf("%d%d" , &n , &m);
	for(int i = 1 ; i <= n ; i++)
		p[i] = i ;
	for(int i = 1 , x , y ; i <= m ; i++)
	{
		scanf("%d%d" , &x , &y);
		int X = find(x) , Y = find(y);
		if(X == Y) continue;
		else
			p[X] = p[Y];
	}
	for(int i = 1 ; i <= n ; i++)
		size[find(i)]++;
	for(int i = 1 ; i <= n ; i++)
		ans = max(ans , size[i]);
	printf("%d" , ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: reference to 'size' is ambiguous
   27 |                 size[find(i)]++;
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:6:12: note:                 'int size [200010]'
    6 | int p[N] , size[N] , n , m , ans;
      |            ^~~~
a.cc:29:33: error: reference to 'size' is ambiguous
   29 |                 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:6:12: note:                 'int size [200010]'
    6 | int p[N] , size[N] , n , m , ans;
      |            ^~~~
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.next();
    int M=sc.next();
    Integer[][] data=new Integer[2][M];
    List<List<Integer>> friends=new ArrayList<>();
    int res1=-1;
	int res2=-1;
    for(int i=0;i<M;i++){
     String[] lineData=sc.nextLine().split(" ");
	 data[0][i]=Integer.parseInt(lineData[0]);
     data[1][i]=Integer.parseInt(lineData[1]);
	 res1=res2=-1;     
     for(int j=0;j<friends.size();j++){
       if(friends.get(j).contains(data[0][i])){
         res1=j
       }
       if(friends.get(j).contains(data[0][i])){
         res2=j
       }
     }
     if(res1!=-1 && res2==-1){
       friends.get(res1).add(data[1][i]);
     }else if(res1==-1 && res2!=-1){
       friends.get(res2).add(data[0][i]);
     }else if(res1!=-1 && res2!=-1){
       friends.get(res1).addAll(friends.get(res2));
       friends.remove(res2);
     }else{
       friends.add((new ArrayList<Integer>()).add(data[0][i]).add(data[1][i]));
             
     }
    }
    int biggest=0;
	for(int i=0;i<friends.size();i++){
      if(biggest<friends.get(i).size()){
        biggest=friends.get(i).size();
      }
    }
    System.out.println(biggest);
  }
}

Compiler output:
Main.java:19: error: ';' expected
         res1=j
               ^
Main.java:22: error: ';' expected
         res2=j
               ^
2 errors
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define ff first
#define ss second
#define forr(i,a,n) for(ll i=a;i<n;i++)
#define ford(i,a,n) for(ll i=n-1;i>=a;i--)
#define all(v) v.begin(),v.end()
#define testc  ll ts;\
               cin>>ts;\
               while(ts--)
#define arn ll n;\
            cin>>n;\
            ll a[n];\
            forr(i,0,n)cin>>a[i];\
               
#define arr(a,n) ll a[n];\
                 forr(i,0,n)cin>>a[i];\
 
#define sss <<" "<<
#define nnn <<"\n"
#define nl cout<<"\n";
#define prtitr(v) for(auto itr=v.begin(); itr!=v.end() ; itr++)cout<<*itr<<" ";
#define fitr(v) for(auto itr=v.begin(); itr!=v.end() ; itr++)
using namespace std;
ll M=1e9+7;
ll cdiv(ll a,ll b){
    return (a%b==0)?a/b:a/b+1;
}
ll myMod(ll a, ll b){
    ll r = a % b;
    return r < 0 ? r + b : r;
}
ll ModPow(ll a,ll b,ll M)
{
    if(M==1)return 0;
    a%=M;
    ll ans=1,t=1;
    while(t>0&&t<=b)
    {
        if(t&b)
        {
            ans*=a;
            ans%=M;
        }
        t<<=1;
        a*=a;
        a%=M;
    }
    return ans;
}


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n,m1;
    cin>>n>>m1;
    if(m1==0){
        cout<<1;
        return 0;
    }
    vector<vector<ll>> v;
    ll a[n+1]={0};

    ll curr=1;
    forr(i,0,m1){
        ll a,b;
        cin>>a>>b;
        if(m[a]==0 && m[b]==0){
            vector<ll> s;
            s.push_back(a);
            s.push_back(b);
            v.emplace_back(s);
            m[a]=curr,m[b]=curr;
            curr++;
        }else if(m[a]==0){
            v[m[b]-1].push_back(a);
            m[a]=m[b];
        }else if(m[b]==0){
            v[m[a]-1].push_back(b);
            m[b]=m[a];
        }
    }
    ll mx=-1;
    forr(i,0,v.size()){
        mx=max(mx,(ll)v[i].size());
    }
    cout<<mx;
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:71:12: error: 'm' was not declared in this scope
   71 |         if(m[a]==0 && m[b]==0){
      |            ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;

const int N = 200010;
int p[N] , size[N] , n , m , ans;

int find(int x)
{
	return p[x] == x ? x : p[x] = find(p[x]);
}

int main()
{
	scanf("%d%d" , &n , &m);
	for(int i = 1 ; i <= n ; i++)
		p[i] = i ;
	for(int i = 1 , x , y ; i <= m ; i++)
	{
		scanf("%d%d" , &x , &y);
		int X = find(x) , Y = find(y);
		if(X == Y) continue;
		else
			p[X] = p[Y];
	}
	for(int i = 1 ; i <= n ; i++)
		size[find(i)]++;
	for(int i = 1 ; i <= n ; i++)
		ans = max(ans , size[i]);
	printf("%d" , ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: reference to 'size' is ambiguous
   27 |                 size[find(i)]++;
      |                 ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:6:12: note:                 'int size [200010]'
    6 | int p[N] , size[N] , n , m , ans;
      |            ^~~~
a.cc:29:33: error: reference to 'size' is ambiguous
   29 |                 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:6:12: note:                 'int size [200010]'
    6 | int p[N] , size[N] , n , m , ans;
      |            ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int n,m;
  	cin >> n;
  	cin >> m;
  	int a,b;
    vector<int> g[n+5];
  	for(int i=0;i<m;i++)
    {
    	cin >> a>> b;
      	g[a].push_back(b);
    }
  	int check[n+5];
  	for(int i=1;i<=n;i++)
    {
    	check[i]=0;
    }
  	stack<int> st;
  	int cn = 0;
  	int max = INT_MIN;
  	for(int i=1;i<=n;i++)
    {
      cn = 0;
    	if(check[i]==0)
        {
        	st.push(i);
          	cn++;
          	while(!st.empty())
            {
              top = st.top();
              st.pop();
              check[top]=1;
              int k = g[top].size();
              for(int j = 0;j<k;j++)
              {
                  if(check[g[top][j]]==0)
                  {
                    cn++;
                      st.push(g[top][j]);
                      check[g[top][j]] = 1;
                  }
              }
            }
          if(cn>max)
          {
            max = cn;
          }
        }
    }
  	cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: 'top' was not declared in this scope
   32 |               top = st.top();
      |               ^~~
Language: C++

#include<bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define mp make_pair
#define PI acos(-1)
using namespace std;
ll n,m;
vector<ll>g[200005],v;
bool visit[200005];
set<ll>s;
void dfs(ll node)
{
    visit[node]=1;
    s.insert(node);
    for(auto child:g[node])
    {
        if(!visit[child])
            dfs(child);
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,x,y,z,t,b,c,d,a,l,r;
    cin>>n>>m;
    for(i=1; i<=m; i++)
    {
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    for(i=1; i<=n; i++)
    {

        if(!visit[i])
        {
            dfs(i);
            v.pb(s.size());
            s.clear();
        }
    }
    sort(v.rbegin(),v.rend());
    if(v.size()==1)
        cout<<v[0]<<'\n';
    else
        cout<<(v[0]-v[1])+v[1]<<'\n';
}














Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:13:5: error: reference to 'visit' is ambiguous
   13 |     visit[node]=1;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
a.cc:17:13: error: reference to 'visit' is ambiguous
   17 |         if(!visit[child])
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:37:13: error: reference to 'visit' is ambiguous
   37 |         if(!visit[i])
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
Language: C++

#include<bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define mp make_pair
#define PI acos(-1)
using namespace std;
ll n,m;
vector<ll>g[200005],v;
bool visit[200005];
set<ll>s;
void dfs(ll node)
{
    visit[node]=1;
    s.insert(node);
    for(auto child:g[node])
    {
        if(!visit[child])
            dfs(child);
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,x,y,z,m,t,n,b,c,d,a,l,r;
    cin>>n>>m;
    for(i=1; i<=m; i++)
    {
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    for(i=1; i<=n; i++)
    {

        if(!visit[i])
        {
            dfs(i);
            v.pb(s.size());
            s.clear();
        }
    }
    sort(v.rbegin(),v.rend());
    if(v.size()==1)
        cout<<v[0]<<'\n';
    else
        cout<<(v[0]-v[1])+v[1]<<'\n';
}














Compiler output:
a.cc: In function 'void dfs(long long int)':
a.cc:13:5: error: reference to 'visit' is ambiguous
   13 |     visit[node]=1;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
a.cc:17:13: error: reference to 'visit' is ambiguous
   17 |         if(!visit[child])
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:37:13: error: reference to 'visit' is ambiguous
   37 |         if(!visit[i])
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:9:6: note:                 'bool visit [200005]'
    9 | bool visit[200005];
      |      ^~~~~
Language: C++

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

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n - 1; i >= 0; i--)
#define ALL(x) x.begin(),x.end()

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

const ll INF = 1e18;
const int mod = 1e9+7;
const int MAX = 1e6;

// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

struct edge {int to, cost;}; // 辺
vector<edge> graph[MAX]; // 隣接リスト
bool visit[MAX]; // 訪問の有無
int cnt = 0, ans = 0;

void dfs(int cur) {
    cnt++;
    visit[cur] = true;
    for (edge e : graph[cur]) {
        if (not visit[e.to]) {
            dfs(e.to);
        }
    }
}

int n, m; // 変数

int main() {
// input
    cin >> n;
    cin >> m;
    rep(i, m) {
        int a, b;
        cin >> a;
        cin >> b;
        graph[a].push_back({b,0});
        graph[b].push_back({a,0});
    }
// solve
    rep(i, n) {
        cnt = 0;
        if (not visit[i]) {
            dfs(i);
            // cout << cnt << "\n";
            ans = max(cnt, ans);
        }
    }
// output
    cout << ans << "\n";
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:25:5: error: reference to 'visit' is ambiguous
   25 |     visit[cur] = true;
      |     ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:20:6: note:                 'bool visit [1000000]'
   20 | bool visit[MAX]; // 訪問の有無
      |      ^~~~~
a.cc:27:17: error: reference to 'visit' is ambiguous
   27 |         if (not visit[e.to]) {
      |                 ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:20:6: note:                 'bool visit [1000000]'
   20 | bool visit[MAX]; // 訪問の有無
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:49:17: error: reference to 'visit' is ambiguous
   49 |         if (not visit[i]) {
      |                 ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:20:6: note:                 'bool visit [1000000]'
   20 | bool visit[MAX]; // 訪問の有無
      |      ^~~~~
Language: C++

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

typedef long long              ll;
typedef long double            ld;
typedef pair<int, int>         pi;
typedef vector<int>            vi;
typedef vector<pair<int, int>> vpi;

#define pb       push_back
#define all(x)   begin(x), end(x)
#define sz(x)    (int)(x).size()
#define ff       first
#define ss       second
#define mp       make_pair
#define lb       lower_bound
#define ub       upper_bound
#define tcase()  int t; cin >> t; while(t--)

const int MOD = 1e9 + 7; // 998244353;
const int MX  = 2e5 + 5;
const ll  INF = 1e18;
const ld  PI  = acos((ld) -1);

void setIO(string name = "") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(sz(name)){
        freopen((name+".in").c_str(), "r", stdin);
        freopen((name+".out").c_str(), "w", stdout);
    }
}

int n, m;
vi adj[MX + 5];
bool visit[MX + 5] = {0};
int cnt = 0, best = 0;

void dfs(int x){
    if(visit[x]) return;
    visit[x] = true;
    cnt++;
    for(auto it : adj[x]){
        dfs(it);
    }
}

int main(){

    setIO();

    cin >> n >> m;

    while(m--){
        int x, y;
        cin >> x >> y;

        adj[x].pb(y), adj[y].pb(x);
    }

    for(int i = 1; i <= n; i++){
        cnt = 0;
        if(!visit[i]){
            dfs(i);
        }
        best = max(best, cnt);
    }

    cout << best;
}


Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:40:8: error: reference to 'visit' is ambiguous
   40 |     if(visit[x]) return;
      |        ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:2:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:36:6: note:                 'bool visit [200010]'
   36 | bool visit[MX + 5] = {0};
      |      ^~~~~
a.cc:41:5: error: reference to 'visit' is ambiguous
   41 |     visit[x] = true;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:36:6: note:                 'bool visit [200010]'
   36 | bool visit[MX + 5] = {0};
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:63:13: error: reference to 'visit' is ambiguous
   63 |         if(!visit[i]){
      |             ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:36:6: note:                 'bool visit [200010]'
   36 | bool visit[MX + 5] = {0};
      |      ^~~~~