criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<vector>

using namespace std;

void dfs(vector<int> & g, vector<bool> & b, int idx)
{
	for (auto p = g[idx].begin(), pd = g[idx].end(); p < pd; p++)
	{
		if (b[*p])
		{
			b[*p] = false;
			dfs(g, b, (*p));
		}
	}
}

int main(void)
{
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  
  int n, m;
  cin >> n >> m;
  
  vector<vector<int>> g;
  g.resize(n);
  
  for (int i = 0, j, k; i < m; i++)
  {
	cin >> j >> k;
	g[j].push_back(k);
	g[k].push_back(j);
  }
  
  vector<bool> b(n, true);

  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
	if (b[i])
	{
	  cnt ++;
	  dfs(g, b, i);
	}
  }
  cout << cnt;
  
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(std::vector<int>&, std::vector<bool>&, int)':
a.cc:8:30: error: request for member 'begin' in '(& g)->std::vector<int>::operator[](((std::vector<int>::size_type)idx))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    8 |         for (auto p = g[idx].begin(), pd = g[idx].end(); p < pd; p++)
      |                              ^~~~~
a.cc:8:62: error: 'pd' was not declared in this scope
    8 |         for (auto p = g[idx].begin(), pd = g[idx].end(); p < pd; p++)
      |                                                              ^~
a.cc: In function 'int main()':
a.cc:45:15: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<std::vector<int> >'
   45 |           dfs(g, b, i);
      |               ^
a.cc:6:24: note: in passing argument 1 of 'void dfs(std::vector<int>&, std::vector<bool>&, int)'
    6 | void dfs(vector<int> & g, vector<bool> & b, int idx)
      |          ~~~~~~~~~~~~~~^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

void dfs(vector<int> & g, vector<bool> & b, int idx)
{
	for (int i : g[idx])
	{
		if (b[i])
		{
			b[i] = false;
			dfs(g, b, i);
		}
	}
}

int main(void)
{
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  
  int n, m;
  cin >> n >> m;
  
  vector<vector<int>> g;
  g.resize(n);
  
  for (int i = 0, j, k; i < m; i++)
  {
	cin >> j >> k;
	g[j].push_back(k);
	g[k].push_back(j);
  }
  
  vector<bool> b(n, true);

  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
	if (b[i])
	{
	  cnt ++;
	  dfs(g, b, i);
	}
  }
  cout << cnt;
  
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(std::vector<int>&, std::vector<bool>&, int)':
a.cc:8:27: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
    8 |         for (int i : g[idx])
      |                           ^
      |                           std::begin
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:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:8:27: error: 'end' was not declared in this scope; did you mean 'std::end'?
    8 |         for (int i : g[idx])
      |                           ^
      |                           std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc: In function 'int main()':
a.cc:45:15: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<std::vector<int> >'
   45 |           dfs(g, b, i);
      |               ^
a.cc:6:24: note: in passing argument 1 of 'void dfs(std::vector<int>&, std::vector<bool>&, int)'
    6 | void dfs(vector<int> & g, vector<bool> & b, int idx)
      |          ~~~~~~~~~~~~~~^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

void dfs(vector<int> & g, vector<bool> & b, int idx)
{
	for (auto i : g[idx])
	{
		if (b[i])
		{
			b[i] = false;
			dfs(g, b, i);
		}
	}
}

int main(void)
{
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  
  int n, m;
  cin >> n >> m;
  
  vector<vector<int>> g;
  g.resize(n);
  
  for (int i = 0, j, k; i < m; i++)
  {
	cin >> j >> k;
	g[j].push_back(k);
	g[k].push_back(j);
  }
  
  vector<bool> b(n, true);

  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
	if (bool[i])
	{
	  cnt ++;
	  dfs(g, b, i);
	}
  }
  cout << cnt;
  
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(std::vector<int>&, std::vector<bool>&, int)':
a.cc:8:28: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
    8 |         for (auto i : g[idx])
      |                            ^
      |                            std::begin
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:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:8:28: error: 'end' was not declared in this scope; did you mean 'std::end'?
    8 |         for (auto i : g[idx])
      |                            ^
      |                            std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc: In function 'int main()':
a.cc:42:17: error: expected unqualified-id before '[' token
   42 |         if (bool[i])
      |                 ^
a.cc:45:15: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<std::vector<int> >'
   45 |           dfs(g, b, i);
      |               ^
a.cc:6:24: note: in passing argument 1 of 'void dfs(std::vector<int>&, std::vector<bool>&, int)'
    6 | void dfs(vector<int> & g, vector<bool> & b, int idx)
      |          ~~~~~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>

using namespace std;

const int maxn = 200010;

int n, m;
int cnt[maxn];
int f[maxn];
int ans = 0;
int find(int x)
{
	if(f[x] == x)
	{
		return x;
	}
	return find(f[x]);
}
void unionn(int x, int y)
{
	int fx = find(x);
	int fy = find(y);
	f[fx] = fy;
}
int main()
{
	cin >> n >> m;
		 
	for(int i = 1; i <= n; i++)
	{
		f[i] = i;
		//cnt[i] = 1;
	}
	for(int i = 1; i <= m; i++)
	{
		int a, b;
		cin >> a >> b;
		unionn(a, b);
	}
	for(int i = 1; i <= n; i++)
	{
		cnt[find(i)]++;
	}
cout << *max_element(cnt+1,cnt+n+1)　<< endl; 
	return 0;
}

Compiler output:
a.cc:44:36: error: extended character 　 is not valid in an identifier
   44 | cout << *max_element(cnt+1,cnt+n+1)　<< endl;
      |                                    ^
a.cc: In function 'int main()':
a.cc:44:36: error: expected ';' before '\U00003000'
   44 | cout << *max_element(cnt+1,cnt+n+1)　<< endl;
      |                                    ^~
      |                                    ;
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>;

struct UnionFind {
	// それ自身の場合はsize の-1 掛けたもの
	// それ以外は自分の親のid
	vector<int> r;

	UnionFind(int N) {
		r = vector<int>(N, -1);
	}

	int root(int x) {
		if (r[x] < 0) return x;
		return r[x] = root(r[x]);
	}

	bool unite(int x, int y){
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (r[x] > r[y]) swap(x,y);
		r[x] += r[y];
		r[y] = x;
		return true;
	}

	int size(int x){
		return -r[root(x)];
	}
};
int main() {
	int n,m;
	cin >> n >> m;
	UnionFind UF(n);
	rep(i,m) {
		int a, b;
		cin >> a >> b;
		a--;b--;
		UF.unite(a,b);
	}
	int ans=0;
	rep(i,n) {
		ans = max(ans, UF.size[i]);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:39: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   47 |                 ans = max(ans, UF.size[i]);
      |                                       ^
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>;

struct UnionFind {
	// それ自身の場合はsize の-1 掛けたもの
	// それ以外は自分の親のid
	vector<int> r;

	UnionFind(N) {
		r = vector<int>(N, -1);
	}

	int root(int x) {
		if (r[x] < 0) return x;
		return r[x] = root(r[x]);
	}

	bool unite(int x, int y){
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (r[x] > r[y]) swap(x,y);
		r[x] += r[y];
		r[y] = x;
		return true;
	}

	int size(int x){
		return -r[root(x)]
	}
};
int main() {
	int n,m;
	cin >> n >> m;
	UnionFind UF(n);
	rep(i,m) {
		int a, b;
		cin >> a >> b;
		a--;b--;
		UF.unite(a,b);
	}
	int ans=0;
	rep(i,n) {
		ans = max(ans, UF.size[i]);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:12:19: error: field 'N' has incomplete type 'UnionFind'
   12 |         UnionFind(N) {
      |                   ^
a.cc:7:8: note: definition of 'struct UnionFind' is not complete until the closing brace
    7 | struct UnionFind {
      |        ^~~~~~~~~
a.cc:14:9: error: expected ';' at end of member declaration
   14 |         }
      |         ^
      |          ;
a.cc: In member function 'int UnionFind::size(int)':
a.cc:33:9: error: expected ';' before '}' token
   33 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:38:23: error: no matching function for call to 'UnionFind::UnionFind(int&)'
   38 |         UnionFind UF(n);
      |                       ^
a.cc:7:8: note: candidate: 'UnionFind::UnionFind()'
    7 | struct UnionFind {
      |        ^~~~~~~~~
a.cc:7:8: note:   candidate expects 0 arguments, 1 provided
a.cc:7:8: note: candidate: 'UnionFind::UnionFind(const UnionFind&)'
a.cc:7:8: note:   no known conversion for argument 1 from 'int' to 'const UnionFind&'
a.cc:7:8: note: candidate: 'UnionFind::UnionFind(UnionFind&&)'
a.cc:7:8: note:   no known conversion for argument 1 from 'int' to 'UnionFind&&'
a.cc:47:39: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   47 |                 ans = max(ans, UF.size[i]);
      |                                       ^
Language: C++

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

vector<ll> adj[200006];
vector<bool> visit;

void dfs(ll node,ll &c)
{
    visit[node]=true;
    c++;
    for(auto child:adj[node])
    {
        if(visit[child]==false)
        {
            dfs(child,c);
        }
    }
}

void solve()
{
    ll n,e,a,b,res=0,c,i;
    cin>>n>>e;
    visit.resize(n+1,false);

    while(e--)
    {
        cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    for(i=1;i<=n;i++)
    {
        if(visit[i]==false)
        {
            c=0;
            dfs(i,c);
            res=max(res,c);
        }
    }

    cout<<res;
}

int main()
{
   solve();
}


Compiler output:
a.cc: In function 'void dfs(ll, ll&)':
a.cc:10:5: error: reference to 'visit' is ambiguous
   10 |     visit[node]=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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit;
      |              ^~~~~
a.cc:14:12: error: reference to 'visit' is ambiguous
   14 |         if(visit[child]==false)
      |            ^~~~~
/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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit;
      |              ^~~~~
a.cc: In function 'void solve()':
a.cc:25:5: error: reference to 'visit' is ambiguous
   25 |     visit.resize(n+1,false);
      |     ^~~~~
/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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit;
      |              ^~~~~
a.cc:36:12: error: reference to 'visit' is ambiguous
   36 |         if(visit[i]==false)
      |            ^~~~~
/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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit;
      |              ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, m, visitt[N];
vector<vector<int> > v(N);
int dfs(int n){
    visitt[n] = 1;
    int cnt = 1;
    for(int value: v[n])
        if(!visit[value])
            cnt += dfs(value);
    return cnt;
}
int main(){
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    int mx = 0;
    for(int i = 1; i <= n; i++){
        if(!visitt[i]){
            mx = max(mx, dfs(i));
        }
    }
    cout << mx << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:10:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   10 |         if(!visit[value])
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, m, visit[N];
vector<vector<int> > v(N);
int dfs(int n){
    visit[n] = 1;
    int cnt = 1;
    for(int value: v[n])
        if(!visit[value])
            cnt += dfs(value);
    return cnt;
}
int main(){
    cin >> n >> m;
    for(int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    int mx = 0;
    for(int i = 1; i <= n; i++){
        if(!visit[i]){
            mx = max(mx, dfs(i));
        }
    }
    cout << mx << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:7:5: error: reference to 'visit' is ambiguous
    7 |     visit[n] = 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:4:11: note:                 'int visit [200010]'
    4 | int n, m, visit[N];
      |           ^~~~~
a.cc:10:13: error: reference to 'visit' is ambiguous
   10 |         if(!visit[value])
      |             ^~~~~
/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:4:11: note:                 'int visit [200010]'
    4 | int n, m, visit[N];
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:24:13: error: reference to 'visit' is ambiguous
   24 |         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:4:11: note:                 'int visit [200010]'
    4 | int n, m, visit[N];
      |           ^~~~~
Language: C++


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;

struct UnionFind
{
    vector<int64_t> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int64_t N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = -1;
    }

    u_int64_t root(int64_t x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] < 0)
            return x;
        return par[x] = root(par[x]);
    }

    bool unite(int64_t x, int64_t y)
    {                     // xとyの木を併合
        int64_t rx = root(x); //xの根をrx
        int64_t ry = root(y); //yの根をry
        if (rx == ry)
            return false;   //xとyの根が同じ(=同じ木にある)時はそのまま
        if (par[x] > par[y]) {
            tmp = x;
            x = y;
            y = tmp;
        }
        par[rx] += par[y];
        par[ry] = rx; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        return true;
    }

    bool same(int64_t x, int64_t y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int64_t rx = root(x);
        int64_t ry = root(y);
        return rx == ry;
    }

    int64_t size(int64_t x) {
        return -par[root(x)];
    }
};

void Main() {
    // input
    int64_t N, M;
    cin >> N >> M;

    UnionFind uf(N);
    for (int64_t i = 0; i < M; i++) {
        int64_t A, B;
        cin >> A >> B;
        uf.unite(A, B);
    }

    int64_t count = 0;
    for (int64_t i = 0; i < N; i++) {
        count = max(count, uf.size(i));
    }

    cout << count << endl;

    // process


    // output

}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Compiler output:
a.cc: In member function 'bool UnionFind::unite(int64_t, int64_t)':
a.cc:32:13: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   32 |             tmp = x;
      |             ^~~
      |             tm
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define loop(i,a,b)        for(int i=a;i<b;i++)
vector<int>ad[200005];
int visit[200005];
int dfs(int z){
	int ans=0;
	if(visit[z]==0){
		visit[z]=1;
		ans++;
		for(auto v:ad[z])ans+=dfs(v);
	}
    return ans;

}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output1.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int n,m,x,y;
	cin>>n>>m;
	loop(i,0,m){
		cin>>x>>y;
		x-=1;
		y-=1;
	    ad[x].pb(y);
	    ad[y].pb(x);
	}
	int mx=0;
	for(int i=0;i<n;i++){
		if(visit[i]==0)mx=max(mx,dfs(i));
	}
    cout<<mx<<endl;
 
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:8:12: error: reference to 'visit' is ambiguous
    8 |         if(visit[z]==0){
      |            ^~~~~
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:5:5: note:                 'int visit [200005]'
    5 | int visit[200005];
      |     ^~~~~
a.cc:9:17: error: reference to 'visit' is ambiguous
    9 |                 visit[z]=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:5:5: note:                 'int visit [200005]'
    5 | int visit[200005];
      |     ^~~~~
a.cc: In function 'int main()':
a.cc:29:19: error: 'class std::vector<int>' has no member named 'pb'
   29 |             ad[x].pb(y);
      |                   ^~
a.cc:30:19: error: 'class std::vector<int>' has no member named 'pb'
   30 |             ad[y].pb(x);
      |                   ^~
a.cc:34:20: error: reference to 'visit' is ambiguous
   34 |                 if(visit[i]==0)mx=max(mx,dfs(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:5:5: note:                 'int visit [200005]'
    5 | int visit[200005];
      |     ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
//#define int               long long int
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define loop(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll
#define br                break
#define con               continue

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
 
const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

priority_queue<pii, vector<pii>, greater<pii> >q;
vector<int>ad[200005];
int visit[200005];
int dfs(int z){
	int ans=0;
	if(visit[z]==0){
		visit[z]=1;
		ans++;
		for(auto v:ad[z])ans+=dfs(v);
	}
    return ans;

}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output1.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int n,m,x,y;
	cin>>n>>m;
	//memset(visit,0,sizeof(visit));
	loop(i,0,m){
		cin>>x>>y;
		x-=1;
		y-=1;
	    ad[x].pb(y);
	    ad[y].pb(x);
	}
	int mx=0;
	for(int i=0;i<n;i++){
		mx=max(mx,dfs(i));
	}
    cout<<mx<<endl;
 
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:36:12: error: reference to 'visit' is ambiguous
   36 |         if(visit[z]==0){
      |            ^~~~~
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:33:5: note:                 'int visit [200005]'
   33 | int visit[200005];
      |     ^~~~~
a.cc:37:17: error: reference to 'visit' is ambiguous
   37 |                 visit[z]=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:33:5: note:                 'int visit [200005]'
   33 | int visit[200005];
      |     ^~~~~
Language: C++

/*
// Sample code to perform I/O:

#include <iostream>

using namespace std;

int main() {
	int num;
	cin >> num;										// Reading input from STDIN
	cout << "Input number is " << num << endl;		// Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/

// Write your code here
/*
// Sample code to perform I/O:
 
#include <iostream>
 
using namespace std;
 
int main() {
	int num;
	cin >> num;										// Reading input from STDIN
	cout << "Input number is " << num << endl;		// Writing output to STDOUT
}
 
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int fin=0,ans=0;
bool vis[200050];
int dfs(int x , vector <  int  > &v)
{
    if(vis[x]) return 0;
    vis[x]=true; ans++;
    for(auto it: v[x]) if(!vis[it]) dfs(it,v);
}
int main()
{
     int n,m;
     cin>>n>>m;
     vector <  int  > v[n+1];
     for(int i=0;i<m;i++)
     {
         int a,b;
         cin>>a>>b;
         v[a].push_back(b);
         v[b].push_back(a);
     }
     memset(vis,false,sizeof(vis));
     for(int i=1;i<=n;i++)
     {
         if(!vis[i])
         {
             ans=0;
             dfs(i,v);
         }
         fin=max(fin,ans);
     } 
     cout<<fin;
 
    }


Compiler output:
a.cc: In function 'int dfs(int, std::vector<int>&)':
a.cc:42:21: error: 'begin' was not declared in this scope
   42 |     for(auto it: v[x]) if(!vis[it]) dfs(it,v);
      |                     ^
a.cc:42:21: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:33:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:42:21: error: 'end' was not declared in this scope
   42 |     for(auto it: v[x]) if(!vis[it]) dfs(it,v);
      |                     ^
a.cc:42:21: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc: In function 'int main()':
a.cc:62:20: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<int> [(n + 1)]'
   62 |              dfs(i,v);
      |                    ^
a.cc:38:35: note: in passing argument 2 of 'int dfs(int, std::vector<int>&)'
   38 | int dfs(int x , vector <  int  > &v)
      |                 ~~~~~~~~~~~~~~~~~~^
a.cc: In function 'int dfs(int, std::vector<int>&)':
a.cc:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
Language: C++

/*
// Sample code to perform I/O:

#include <iostream>

using namespace std;

int main() {
	int num;
	cin >> num;										// Reading input from STDIN
	cout << "Input number is " << num << endl;		// Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/

// Write your code here
/*
// Sample code to perform I/O:
 
#include <iostream>
 
using namespace std;
 
int main() {
	int num;
	cin >> num;										// Reading input from STDIN
	cout << "Input number is " << num << endl;		// Writing output to STDOUT
}
 
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int fin=0,ans=0;
bool vis[200050];
int dfs(int x , vector < vector < int > > &v)
{
    if(vis[x]) return 0;
    vis[x]=true; ans++;
    for(auto it: v[x]) if(!vis[it]) dfs(it,v);
}
int main()
{
     int n,m;
     cin>>n>>m;
     vector <  int  > v(n+1);
     for(int i=0;i<m;i++)
     {
         int a,b;
         cin>>a>>b;
         v[a].push_back(b);
         v[b].push_back(a);
     }
     memset(vis,false,sizeof(vis));
     for(int i=1;i<=n;i++)
     {
         if(!vis[i])
         {
             ans=0;
             dfs(i,v);
         }
         fin=max(fin,ans);
     } 
     cout<<fin;
 
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:53:15: error: request for member 'push_back' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)a))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   53 |          v[a].push_back(b);
      |               ^~~~~~~~~
a.cc:54:15: error: request for member 'push_back' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   54 |          v[b].push_back(a);
      |               ^~~~~~~~~
a.cc:62:20: error: invalid initialization of reference of type 'std::vector<std::vector<int> >&' from expression of type 'std::vector<int>'
   62 |              dfs(i,v);
      |                    ^
a.cc:38:44: note: in passing argument 2 of 'int dfs(int, std::vector<std::vector<int> >&)'
   38 | int dfs(int x , vector < vector < int > > &v)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc: In function 'int dfs(int, std::vector<std::vector<int> >&)':
a.cc:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
Language: C++

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

vector<int> adj[200005];
bool vis[200005];
int maxi=0;


void solve(){

    //ifstream myfile;
    //myfile.open("sample.txt");
    int n,m;
    cin >> n >> m;
    memset(vis, false, sizeof(vis));

    int a;
    int b;
    while(m--){
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    for(int i=0;i<n;i++){
        if(!vis[i]){
            maxi=max(maxi,dfs(i));
            }
        }
        cout<<maxi;
    return;
}

int dfs(int u){
    int ans = 0;
    if(!vis[u]){
            ans++;
            vis[u] = true;
            for(auto v: adj[u]){
            ans += dfs(v);
            }
    }
    return ans;
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:27:27: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   27 |             maxi=max(maxi,dfs(i));
      |                           ^~~
      |                           ffs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
vector<int>ar[200001];
int vis[200001];
int size;
int maximum=INT_MIN;
void DFS(int node){
   vis[node]=1;
   size++;
   
   for(int child:ar[node]){
       if(!vis[child]){
         DFS(child);
       }
   }

}
int main(){
  int n,m,a,b;
  cin>>n>>m;
  for(int i=1;i<=m;i++){
      cin>>a>>b;
     ar[a].push_back(b);
     ar[b].push_back(a); 

  }
 for(int i=1;i<=n;i++){
    if(!vis[i]){
      size=0;
      DFS(i);
   maximum=max(maximum,size);
    }
 }
	
cout<<maximum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void DFS(int)':
a.cc:10:4: error: reference to 'size' is ambiguous
   10 |    size++;
      |    ^~~~
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:6:5: note:                 'int size'
    6 | int size;
      |     ^~~~
a.cc: In function 'int main()':
a.cc:30:7: error: reference to 'size' is ambiguous
   30 |       size=0;
      |       ^~~~
/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:5: note:                 'int size'
    6 | int size;
      |     ^~~~
a.cc:32:24: error: reference to 'size' is ambiguous
   32 |    maximum=max(maximum,size);
      |                        ^~~~
/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:5: note:                 'int size'
    6 | int size;
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
vector<int>ar[200001];
int vis[200001];
int size;
int maximum=INT_MIN;
void DFS(int node){
   vis[node]=1;
   size++;
   maximum=max(maximum,size);
   for(int child:ar[node]){
       if(!vis[child]){
         DFS(child);
       }
   }

}
int main(){
  int n,m,a,b;
  cin>>n>>m;
  for(int i=1;i<=m;i++){
      cin>>a>>b;
     ar[a].push_back(b);
     ar[b].push_back(a); 

  }
 for(int i=1;i<=n;i++){
    if(!vis[i]){
      size=0;
      DFS(i);
    }
 }
	
cout<<maximum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void DFS(int)':
a.cc:10:4: error: reference to 'size' is ambiguous
   10 |    size++;
      |    ^~~~
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:6:5: note:                 'int size'
    6 | int size;
      |     ^~~~
a.cc:11:24: error: reference to 'size' is ambiguous
   11 |    maximum=max(maximum,size);
      |                        ^~~~
/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:5: note:                 'int size'
    6 | int size;
      |     ^~~~
a.cc: In function 'int main()':
a.cc:30:7: error: reference to 'size' is ambiguous
   30 |       size=0;
      |       ^~~~
/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:5: note:                 'int size'
    6 | int size;
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define endl "\n"
#define lln long long unsigned int
#define IOS ios::sync_with_stdio(0);cin.tie(0);
vector<int> visit;
vector<vector<int>> adj;
int ans=0;

const lln MOD = 1e9 + 7;

void dfs(int u){
    visit[u] = 1;
    ans++;
    for(auto i : adj[u]){
        if(!visit[i]) dfs(i);
    }
}

int main(){
    IOS;

    int n,m;
    cin >> n >> m;
    visit = vector<int> (n+1);
    adj = vector<vector<int>> (n+1);
    for(int i=0,x,y;i<m;i++){
        cin >> x >> y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    int ma = 0;
    for(int i=1;i<=n;i++){
        if(!visit[i]) dfs(i);
        ma = max(ma,ans);
        ans = 0;
    }
    cout << ma << endl;
    return 0;    
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:15:5: error: reference to 'visit' is ambiguous
   15 |     visit[u] = 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:8:13: note:                 'std::vector<int> visit'
    8 | vector<int> visit;
      |             ^~~~~
a.cc:18:13: error: reference to 'visit' is ambiguous
   18 |         if(!visit[i]) dfs(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:8:13: note:                 'std::vector<int> visit'
    8 | vector<int> visit;
      |             ^~~~~
a.cc: In function 'int main()':
a.cc:27:5: error: reference to 'visit' is ambiguous
   27 |     visit = vector<int> (n+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:8:13: note:                 'std::vector<int> visit'
    8 | vector<int> visit;
      |             ^~~~~
a.cc:36:13: error: reference to 'visit' is ambiguous
   36 |         if(!visit[i]) dfs(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:8:13: note:                 'std::vector<int> visit'
    8 | vector<int> visit;
      |             ^~~~~
Language: Java

// Born Sinner
// old but im not that old
// fuck all you hoes get a grip
import java.util.*;
import java.lang.*;
import java.io.*;

public class codeforces
{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(next());
        }
        long nextLong(){
            return Long.parseLong(next());
        }
        double nextDouble(){
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            } catch (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
    static int modPower(int x, int y, int mod){
        int res = 1;
        x %= mod;
        if(x==0) return 0;
        while(y>0){
            if(y%2==1){
                res = (res*x)%mod;
            }
            y = y>>1;
            x = (x*x)%mod;
        }
        return res;
    }
    static class pair<T1, T2>{
        T1 first;
        T2 second;
        pair(T1 first, T2 second){
            this.first = first;
            this.second = second;
        }
    }
    static int bfs(Map<Integer,Set<Integer>> g, int u, boolean[] vis){
      if(vis[u]) return 0;
      Queue<Integer> q = new LinkedList<>();
      q.add(u);
      int c = 0;
      Set<Integer> s = new HashSet<>();
      while(!q.isEmpty()){
        int x = q.remove();
        vis[x] = true;
        s.add(x);
        if(g.containsKey(x)) for(int i : g.get(x)) {
          if(!vis[i]) {
            q.add(i);
          }
        }
      }
      return s.size();
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        FastReader in = new FastReader();
        int t = 1;
        //t = in.nextInt();
        while(t-->0){
            int n = in.nextInt(), m = in.nextInt();
            Map<Integer, Set<Integer>> g = new HashMap<>();
            for(int i = 0; i < m; i++) {
              int a = in.nextInt(), b = in.nextInt();
              if(!g.containsKey(a)) {
                g.put(a, new HashSet<>());
              }
              if(!g.containsKey(b)) {
                g.put(b, new HashSet<>());
              }
              g.get(a).add(b);
              g.get(b).add(a);
            }
            int ans = 0;
            boolean[] vis = new boolean[n+1];
            for(int i = 1; i <= n; i++){
              ans = Math.max(ans, bfs(g, i, vis));
            }
            System.out.println(ans);
        }
    }
}


Compiler output:
Main.java:8: error: class codeforces is public, should be declared in a file named codeforces.java
public class codeforces
       ^
1 error
Language: Java

// Born Sinner
// old but im not that old
// fuck all you hoes get a grip
import java.util.*;
import java.lang.*;
import java.io.*;

public class 
{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(next());
        }
        long nextLong(){
            return Long.parseLong(next());
        }
        double nextDouble(){
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            } catch (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
    static int modPower(int x, int y, int mod){
        int res = 1;
        x %= mod;
        if(x==0) return 0;
        while(y>0){
            if(y%2==1){
                res = (res*x)%mod;
            }
            y = y>>1;
            x = (x*x)%mod;
        }
        return res;
    }
    static class pair<T1, T2>{
        T1 first;
        T2 second;
        pair(T1 first, T2 second){
            this.first = first;
            this.second = second;
        }
    }
    static int bfs(Map<Integer,Set<Integer>> g, int u, boolean[] vis){
      if(vis[u]) return 0;
      Queue<Integer> q = new LinkedList<>();
      q.add(u);
      int c = 0;
      Set<Integer> s = new HashSet<>();
      while(!q.isEmpty()){
        int x = q.remove();
        vis[x] = true;
        s.add(x);
        if(g.containsKey(x)) for(int i : g.get(x)) {
          if(!vis[i]) {
            q.add(i);
          }
        }
      }
      return s.size();
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        FastReader in = new FastReader();
        int t = 1;
        //t = in.nextInt();
        while(t-->0){
            int n = in.nextInt(), m = in.nextInt();
            Map<Integer, Set<Integer>> g = new HashMap<>();
            for(int i = 0; i < m; i++) {
              int a = in.nextInt(), b = in.nextInt();
              if(!g.containsKey(a)) {
                g.put(a, new HashSet<>());
              }
              if(!g.containsKey(b)) {
                g.put(b, new HashSet<>());
              }
              g.get(a).add(b);
              g.get(b).add(a);
            }
            int ans = 0;
            boolean[] vis = new boolean[n+1];
            for(int i = 1; i <= n; i++){
              ans = Math.max(ans, bfs(g, i, vis));
            }
            System.out.println(ans);
        }
    }
}


Compiler output:
Main.java:8: error: <identifier> expected
public class 
            ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int p[200010],sum[200010];
inline int dsu(int x){
    return p[x]==x?x:p[x]=dsu(p[x]);
}
inline int main(void) {
    int n,m,mx=0;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++){
    	p[i]=i;
    	sum[i]=1;
	}
    while(m--) {
        int u,v;
        scanf("%d%d",&u,&v);
        x=dsu(u);
        y=dsu(v);
        if(x!=y) {
            p[x]=y;
            sum[y]+=sum[x];
        }
    }
    for(int i=1;i<=n;i++) {
        if(p[i]==i) {
            mx=max(mx,sum[i]);
        }
    }
    printf("%d\n",mx);
    return 0;
}

Compiler output:
a.cc:7:1: error: cannot declare '::main' to be inline
    7 | inline int main(void) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:9: error: 'x' was not declared in this scope
   17 |         x=dsu(u);
      |         ^
a.cc:18:9: error: 'y' was not declared in this scope
   18 |         y=dsu(v);
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int p[200010],sum[200010];
inline int dsu(int x){
    return f[x]==x?x:f[x]=dsu(f[x]);
}
inline int main(void) {
    int n,m,mx=0;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++){
    	p[i]=i;
    	sum[i]=1;
	}
    while(m--) {
        int u,v;
        scanf("%d%d",&u,&v);
        x=dsu(u);
        y=dsu(v);
        if(x!=y) {
            p[x]=y;
            sum[y]+=sum[x];
        }
    }
    for(int i=1;i<=n;i++) {
        if(p[i]==i) {
            mx=max(mx,sum[i]);
        }
    }
    printf("%d\n",mx);
    return 0;
}

Compiler output:
a.cc: In function 'int dsu(int)':
a.cc:5:12: error: 'f' was not declared in this scope
    5 |     return f[x]==x?x:f[x]=dsu(f[x]);
      |            ^
a.cc: At global scope:
a.cc:7:1: error: cannot declare '::main' to be inline
    7 | inline int main(void) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:17:9: error: 'x' was not declared in this scope
   17 |         x=dsu(u);
      |         ^
a.cc:18:9: error: 'y' was not declared in this scope
   18 |         y=dsu(v);
      |         ^