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

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

const ll mod=1000000007;

int ret=0;
vector<int> visit;

int bfs(const Graph& g,int i){
    visit[i]=1;
    for(auto next:g[i]){
        if(visit[next]!=0)continue;
        ret=bfs(g,next)+1;
    }
    return ret;
} 

int main(){
    int n,m;
    cin>>n>>m;
    Graph G(n);
    visit.assign(n,0);
    rep(i,m){
        int a,b;
        cin>>a>>b;
        a--;
        b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    int ans=0;
    rep(i,n){
        ans=max(ans,bfs(G,i));
        visit.assign(n,0);
        ret=0;
    }
    cout<<ans+1<<endl;

}

Compiler output:
a.cc: In function 'int bfs(const Graph&, int)':
a.cc:14:5: error: reference to 'visit' is ambiguous
   14 |     visit[i]=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:11:13: note:                 'std::vector<int> visit'
   11 | vector<int> visit;
      |             ^~~~~
a.cc:16:12: error: reference to 'visit' is ambiguous
   16 |         if(visit[next]!=0)continue;
      |            ^~~~~
/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:11:13: note:                 'std::vector<int> visit'
   11 | vector<int> visit;
      |             ^~~~~
a.cc: In function 'int main()':
a.cc:26:5: error: reference to 'visit' is ambiguous
   26 |     visit.assign(n,0);
      |     ^~~~~
/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:11:13: note:                 'std::vector<int> visit'
   11 | vector<int> visit;
      |             ^~~~~
a.cc:38:9: error: reference to 'visit' is ambiguous
   38 |         visit.assign(n,0);
      |         ^~~~~
/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:11:13: note:                 'std::vector<int> visit'
   11 | vector<int> visit;
      |             ^~~~~
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> f(m,vector<int>(2));
  vector<int> s(m);
  set<int> result;
  int a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    f.at(i).at(0)=a;
    f.at(i).at(1)=b;
    s.at(i)=i;
  }
  int max=1;
  bool add=true;
  while(s.size()>0){
    if(add){
      if(result.size()>max){
        max=result.size();
      }
      auto i=s.begin();
      result={f.at(*i).at(0),f.at(*i).at(1)};
      s.erase(i);
    }
    if(s.size()==0){
      break;
    }
    add=true;
    for(auto i=0;i<s.size();i++){
      if(result.count(f.at(s.at(i)).at(0))){
        result.insert(f.at(s.at(i)).at(1));
        add=false;
        s.erase(s.begin()+i);
        i--;
      }else if(result.count(f.at(s.at(i)).at(1))){
        result.insert(f.at(a.at(i)).at(0));
        add=false;
        s.erase(s.begin()+i);
        i--;
      }
    }
  }
  if(result.size()>max){
    max=result.size();
  }
  cout<<max<<endl;
}
    
  




Compiler output:
a.cc: In function 'int main()':
a.cc:39:30: error: request for member 'at' in 'a', which is of non-class type 'int'
   39 |         result.insert(f.at(a.at(i)).at(0));
      |                              ^~
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> f(m,vector<int>(2));
  vector<int> s(m);
  set<int> result;
  int a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    f.at(i).at(0)=a;
    f.at(i).at(1)=b;
    s.at(i)=i;
  }
  int max=1;
  bool add=true;
  while(s.size()>0){
    if(add){
      if(result.size()>max){
        max=result.size();
      }
      auto i=s.begin();
      result={f.at(*i).at(0),f.at(*i).at(1)});
      s.erase(i);
    }
    if(s.size()==0){
      break;
    }
    add=true;
    for(auto i=s.begin();i!=s.end();i++){
      if(result.count(f.at(*i).at(0))){
        result.insert(f.at(*i).at(1));
        add=false;
        s.erase(i);
        break;
      }else if(result.count(f.at(*i).at(1))){
        result.insert(f.at(*i).at(0));
        add=false;
        s.erase(i);
        break;
      }
    }
  }
  if(result.size()>max){
    max=result.size();
  }
  cout<<max<<endl;
}
    
  




Compiler output:
a.cc: In function 'int main()':
a.cc:25:45: error: expected ';' before ')' token
   25 |       result={f.at(*i).at(0),f.at(*i).at(1)});
      |                                             ^
      |                                             ;
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> f(m,vector<int>(2));
  set<int> s;
  vector<set<int>> result;
  int a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    f.at(i).at(0)=a;
    f.at(i).at(1)=b;
    s.insert(i);
  }
  int max=0;
  bool add=true;
  while(s.size()>0){
    if(add){
      if(result.size()>0){
        if(result.at(result.size()-1).size()>max){
          max=result.at(reault.size()-1).size();
        }
      }
      auto i=s.begin();
      result.push_back({f.at(*i).at(0),f.at(*i).at(1)});
      s.erase(i);
    }
    if(s.size()==0){
      break;
    }
    add=true;
    for(auto i=s.begin();i!=s.end();i++){
      if(result.at(result.size()-1).count(f.at(*i).at(0))){
        result.at(result.size()-1).insert(f.at(*i).at(1));
        add=false;
        s.erase(i);
        break;
      }else if(result.at(result.size()-1).count(f.at(*i).at(1))){
        result.at(result.size()-1).insert(f.at(*i).at(0));
        add=false;
        s.erase(i);
        break;
      }
    }
  }
  if(result.size()>0){
    if(result.at(result.size()-1).size()>max){
      max=result.at(result.size()-1).size();
    }
  }
  cout<<max<<endl;
}
    
  



Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: 'reault' was not declared in this scope; did you mean 'result'?
   23 |           max=result.at(reault.size()-1).size();
      |                         ^~~~~~
      |                         result
Language: C++

#include <iostream>
#incldue <algorithm>
using namespace std;
const int MAXN = 2e5 + 5; 
const int INF = 0x3f3f3f3f;;
int height[MAXN], s[MAXN];
int n, m;
void setInit(){
	for(int i = 1; i <= n; i++){
		s[i] = i;
		height[i] = 0;
	}
}
int setFind(int x){
	if(x != s[x])  s[x] = setFind(s[x]);
	return s[x];
}
void setUnion(int x, int y){
	x = setFind(x);
	y = setFind(y);
	if(height[x] == height[y]){
		height[x]++;
		s[y] = x;
	}
	else{
		if(height[x] < height[y]) s[x] = y;
		else s[y] = s[x];
	}
}
int main(int argc, char *argv[]){
	scanf("%d %d", &n, &m);
	setInit();
	for(int i = 1; i <= m; i++){
		int x, y;
		scanf("%d %d", &x, &y);
		setUnion(x, y);
	}
	int cnt[MAXN];
	for(int i = 1; i <= n; i++) cnt[i] = setFind(s[i]);
	int ans = -INF;
	sort(cnt + 1, cnt + n + 1);
	int num = 1;
	for(int i = 2; i <= n; i++){
		if(cnt[i] == cnt[i - 1]) num++;
		else ans = max(ans, num), num = 1;
	}	
	cout << max(ans, num);
	return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #incldue; did you mean #include?
    2 | #incldue <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main(int, char**)':
a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   41 |         sort(cnt + 1, cnt + n + 1);
      |         ^~~~
      |         short
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> f(m);
  set<int> s;
  vector<set<int>> result;
  int a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    f.at(i).at(0)=a;
    f.at(i).at(1)=b;
    s.insert(i);
  }
  bool add=true;
  while(s.size()>0){
    auto i;
    if(add){
      i=s.begin();
      result.push_back({f.at(*i).at(0),f.at(*i).at(1)});
      s.erase(i);
    }
    add=true;
    for(auto i=s.begin();i!=s.end();i++){
      if(result.at(result.size()-1).count(f.at(*i).at(0))){
        result.at(result.size()-1).insert(f.at(*i).at(1));
        add=false;
      }else if(result.at(result.size()-1).count(f.at(*i).at(1))){
        result.at(result.size()-1).insert(f.at(*i).at(0));
        add=false;
      }
    }
  }
  int max=0;
  for(int i=0;i<(int)result.size();i++){
    if((int)result.at(i).size()>max){
      max=result.at(i).size();
    }
  }
  cout<<max<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: declaration of 'auto i' has no initializer
   19 |     auto i;
      |     ^~~~
a.cc:22:23: error: no matching function for call to 'std::vector<std::set<int> >::push_back(<brace-enclosed initializer list>)'
   22 |       result.push_back({f.at(*i).at(0),f.at(*i).at(1)});
      |       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::set<int>; _Alloc = std::allocator<std::set<int> >; value_type = std::set<int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::set<int> >::value_type&' {aka 'const std::set<int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::set<int>; _Alloc = std::allocator<std::set<int> >; value_type = std::set<int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::set<int> >::value_type&&' {aka 'std::set<int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int>> f(m);
  set<int> s;
  vector<set<int>> result;
  int a,b;
  bool contain;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    f.at(i).at(0)=a;
    f.at(i).at(1)=b;
    s.insert(i);
  }
  bool add=true;
  while(s.size()>0){
    if(add){
      auto i=s.begin();
      result.push_back({f.at(*i).at(0),f.at(*i).at(1)});
      s.erase(i);
    }
    add=true;
    for(auto i=s.begin();i!=s.end();i++){
      if(result.at(result.size()-1).count(f.at(*i).at(0))){
        result.at(result.size()-1).insert(f.at(*i).at(1));
        add=false;
      }else if(result.at(result.size()-1).count(f.at(*i).at(1))){
        result.at(result.size()-1).insert(f.at(*i).at(0));
        add=false;
      }
    }
  }
  int max=0;
  for(int i=0;i<(int)result.size();i++){
    if((int)result.at(i).size()>max){
      max=reuslt.at(i).size();
    }
  }
  cout<<max<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: 'reuslt' was not declared in this scope; did you mean 'result'?
   39 |       max=reuslt.at(i).size();
      |           ^~~~~~
      |           result
Language: C++

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<set<int>> f;
  int a,b;
  bool contain;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    contain=false;
    for(int j=0;j<f.size();j++){
      if(f.at(i).count(a)){
        f.at(i).insert(b);
        contain=true;
      }else if(f.at(i).count(b)){
        f.at(i).insert(a);
        contain=true;
      }
    }
    if(!contain){
      f.push_back({a,b});
    }
  }
  int max=0;
  for(int i=0;i<f.size();i++){
    if(f.at(i).size().max){
      max=f.at(i).size();
    }
  }
  cout<<max<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: request for member 'max' in '(& f.std::vector<std::set<int> >::at(((std::vector<std::set<int> >::size_type)i)))->std::set<int>::size()', which is of non-class type 'std::set<int>::size_type' {aka 'long unsigned int'}
   28 |     if(f.at(i).size().max){
      |                       ^~~
Language: C

#include <iostream>
#include<vector>
#include<algorithm>//#include<ulity>に
using namespace std;

struct UnionFind{
	vector<int>r;

	UnionFind(int N){//voidは書かない
		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)];//-1*d を-d と書くことができる
		}

};


int main(){
	int N,M;
	cin >> N >> M;

	UnionFind UF(N);

	for(int i=0;i<M;i++){
		int A,B;
		cin>>A>>B;
		UF.unite(A-1,B-1);
	}

	int ans=0;
	for(int i=0;i<N;i++){
    ans=max(ans,UF.size(i));
	}

   cout<<ans<<endl;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<vector>
#include<algorithm>//#include<ulity>に
using namespace std;

struct UnionFind{
	vector<int>r;

	UnionFind(int N){//voidは書かない
		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)];//-1*d を-d と書くことができる
		}

};


int main(){
	int N,M;
	cin >> N >> M;

	UnionFind UF(N);

	for(int i=0;i<M;i++){
		int A,B;
		cin>>A>>B;
		UF.unite(A-1,B-1);
	}

	int ans=0;
	for(int i=0;i<N;i++){
    ans=max(ans,UF.size(i));
	}

   cout<<ans<<endl;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

struct UnionFind{
  vector<int> S;
  
  UnionFind(int N){
    for(int i = 0 ; i < N ; i++) S = vector<int>(N,i);
  }
  
  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    return S.at(x) = root(S.at(x));
  }
  
  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
    S.at(rx) = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
  }
  
  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
  
};

int main(){//main_program
  int N,M,max;
  max = 0;
  cin >> N >> M;
  UnionFind UF(N);

  for(int i = 0; i < M ; i++){
    int k,l;
    cin >> k >> l;
    k--;l--;  
  }
  
  for(int i = 0; i < M ; i++){
    max 
  }
  
  cout << max <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:8: error: expected ';' before '}' token
   46 |     max
      |        ^
      |        ;
   47 |   }
      |   ~
Language: C++

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

int main()
{
   int n,m,a,b;
  cin>>n>>m;
  vector<int> v[n+1];
  while(m--)
  {
   cin>>a>>b;
    st=false;
    for(int i=0;i<v[a].size();i++)
     if(b==v[a][j])
       st=true;
    if(!st)
      a.push_back(b);
    st=false;
     for(int i=0;i<v[b].size();i++)
     if(a==v[b][j])
       st=true;
    if(!st)
      b.push_back(a);
  }
  int s=0;
  for(int i=1;i<n+1;i++)
    if(v[i].size()>s)
      s=v[i].size();
  
  cout<<s+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'st' was not declared in this scope; did you mean 'std'?
   13 |     st=false;
      |     ^~
      |     std
a.cc:15:17: error: 'j' was not declared in this scope
   15 |      if(b==v[a][j])
      |                 ^
a.cc:18:9: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   18 |       a.push_back(b);
      |         ^~~~~~~~~
a.cc:21:17: error: 'j' was not declared in this scope
   21 |      if(a==v[b][j])
      |                 ^
a.cc:24:9: error: request for member 'push_back' in 'b', which is of non-class type 'int'
   24 |       b.push_back(a);
      |         ^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
   int n,m,a,b;
  cin>>n>>m;
  vector<int> v[n+1];
  while(m--)
  {
   cin>>a>>b;
    st=false;
    for(int i=0;i<v[a].size();i++)
     if(b==v[a][j])
       st=true;
    if(!st)
      a.push_back(b);
    st=false;
     for(int i=0;i<v[b].size();i++)
     if(a==v[b][j])
       st=true;
    if(!st)
      b.push_back(a);
  }
  int s=0;
  for(int i=1;i<n+1;i++)
    if(v[i].size()>s)
      s=v[i].size();
  
  cout<<s+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> v[n+1];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> v[n+1];
      |          ^~~
a.cc:12:5: error: 'st' was not declared in this scope; did you mean 'std'?
   12 |     st=false;
      |     ^~
      |     std
a.cc:13:19: error: 'v' was not declared in this scope
   13 |     for(int i=0;i<v[a].size();i++)
      |                   ^
a.cc:14:17: error: 'j' was not declared in this scope
   14 |      if(b==v[a][j])
      |                 ^
a.cc:17:9: error: request for member 'push_back' in 'a', which is of non-class type 'int'
   17 |       a.push_back(b);
      |         ^~~~~~~~~
a.cc:19:20: error: 'v' was not declared in this scope
   19 |      for(int i=0;i<v[b].size();i++)
      |                    ^
a.cc:20:17: error: 'j' was not declared in this scope
   20 |      if(a==v[b][j])
      |                 ^
a.cc:23:9: error: request for member 'push_back' in 'b', which is of non-class type 'int'
   23 |       b.push_back(a);
      |         ^~~~~~~~~
a.cc:27:8: error: 'v' was not declared in this scope
   27 |     if(v[i].size()>s)
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  ll n,m;
  cin >> n >> m;
  vector<vector<ll>> G(n);
  rep(i,m){
    ll a,b;
    cin >> a >> b;
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  ll ans=0;
  queue<ill> que;
  que.push(0);
  vector<ll> dis(n,-1);
  dis.at(0)=0;
  while(!que.empty()){
    ll v=que.front();
    que.pop();
    for(ll nv: G[v]){
      if(dis.at(nv)!=-1){
        continue;
      }
      dis.at(nv)=dis.at(v)+1;
      que.push(nv);
    }
    ans++;
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'ill' was not declared in this scope; did you mean 'kill'?
   18 |   queue<ill> que;
      |         ^~~
      |         kill
a.cc:18:12: error: template argument 1 is invalid
   18 |   queue<ill> que;
      |            ^
a.cc:18:12: error: template argument 2 is invalid
a.cc:19:7: error: request for member 'push' in 'que', which is of non-class type 'int'
   19 |   que.push(0);
      |       ^~~~
a.cc:22:14: error: request for member 'empty' in 'que', which is of non-class type 'int'
   22 |   while(!que.empty()){
      |              ^~~~~
a.cc:23:14: error: request for member 'front' in 'que', which is of non-class type 'int'
   23 |     ll v=que.front();
      |              ^~~~~
a.cc:24:9: error: request for member 'pop' in 'que', which is of non-class type 'int'
   24 |     que.pop();
      |         ^~~
a.cc:30:11: error: request for member 'push' in 'que', which is of non-class type 'int'
   30 |       que.push(nv);
      |           ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
bool used[200005];
vector<int> adj[200005];
int dfs(int u){
    used[u]=1;
    int ret=1;
    for(vector<int> item : adj[u])
    if(!used[item])ret+=dfs(item);
    return ret;
}
int main(){
    int n,m;cin>>n>>m;
    for(int i=0;i<m;i++){
        int u, v;
		cin>>u>>v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    if(!used[i])ans=max(ans,dfs(i));
    cout<<ans<<endl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
bool used[200005];
vector<int> adj[200005];
int dfs(int u){
    used[u]=1;
    int ret=1;
    for(vector<int> item : adj[u])
    if(!used[item])ret+=dfs(item);
    return ret;
}
int main(){
    int n,m;cin>>n>>m;
    for(int i=0;i<m;i++){
        int u, v;
		cin>>u>>v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    int ans=0;
    for(int i=1;i<=n;i++)
    if(!used[i])ans=max(ans,dfs(i));
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:8:33: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
    8 |     for(vector<int> item : adj[u])
      |                                 ^
a.cc:9:13: error: no match for 'operator[]' (operand types are 'bool [200005]' and 'std::vector<int>')
    9 |     if(!used[item])ret+=dfs(item);
      |             ^
a.cc:9:29: error: cannot convert 'std::vector<int>' to 'int'
    9 |     if(!used[item])ret+=dfs(item);
      |                             ^~~~
      |                             |
      |                             std::vector<int>
a.cc:5:13: note:   initializing argument 1 of 'int dfs(int)'
    5 | int dfs(int u){
      |         ~~~~^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main(){
    int n,m;cin>>n>>m;
    vector<vector<int>> d(n);
    for(int i=0;i<m;i++){
        int a,b;cin>>a>>b;
        a--;b--;
        d[a].push_back(b);
        d[b].push_back(a);
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(list[i]==1)continue;
        vector<int> list(n);
        queue<int> q;
        q.push(i);
        list[i]=1;
        int sum=1;
        while(!q.empty()){
            int p=q.front();
            q.pop();
            for(auto np:d[p]){
                list[np]=1;
                q.push(np);
                sum+=1;
            }
        }
        ans=max(ans,sum);
    }
    cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected unqualified-id before '[' token
   15 |         if(list[i]==1)continue;
      |                ^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main(){
    int n,m;cin>>n>>m;
    vector<vector<int>> d(n);
    for(i=0;i<m;i++){
        int a,b;cin>>a>>b;
        a--;b--;
        d[a].push_back(b);
        d[b].push_back(a);
    }
    int ans=0;
    for(int i=0;i<n;i++){
        vector<int> list(n);
        queue<int> q;
        q.push(i);
        list[i]=1;
        int sum=1;
        while(!q.empty()){
            int p=q.front();
            q.pop();
            for(auto np:d[p]){
                list[np]=1;
                q.push(np);
                sum+=1;
            }
        }
        ans=max(ans,sum);
    }
    cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     for(i=0;i<m;i++){
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int Size=1e5+1;
int countl[size];
int p[size];
int find(int x)
{	
	return (x==p[x])?x:p[x]=find(p[x]);
} 
int main()
{
	//int l[100001];
	int n,m;
	while(cin>>n>>m){
		for(int i=0;i<n;i++) p[i]=i;
		while(m--)
		{
			int a,b;
			cin>>a>>b;
			a--,b--;
			int fa=find(a);
			int fb=find(b);
		//	cout<<fa<<" "<<fb<<"\n";
			p[fa]=fb;
		}
		memset(countl,0,sizeof countl);
		int ans=0;
		for(int i=0;i<n;i++)
		{
			ans=max(ans,++countl[find(p[i])]);
		}
		cout<<ans<<"\n";
	}
}

Compiler output:
a.cc:4:16: error: cannot resolve overloaded function 'size' based on conversion to type 'long unsigned int'
    4 | int countl[size];
      |                ^
a.cc:4:5: error: size of array 'countl' has non-integral type '<unresolved overloaded function type>'
    4 | int countl[size];
      |     ^~~~~~
a.cc:5:11: error: cannot resolve overloaded function 'size' based on conversion to type 'long unsigned int'
    5 | int p[size];
      |           ^
a.cc:5:5: error: size of array 'p' has non-integral type '<unresolved overloaded function type>'
    5 | int p[size];
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int size=1e5+1;
int countl[size];
int p[size];
int find(int x)
{	
	return (x==p[x])?x:p[x]=find(p[x]);
} 
int main()
{
	//int l[100001];
	int n,m;
	while(cin>>n>>m){
		for(int i=0;i<n;i++) p[i]=i;
		while(m--)
		{
			int a,b;
			cin>>a>>b;
			a--,b--;
			int fa=find(a);
			int fb=find(b);
		//	cout<<fa<<" "<<fb<<"\n";
			p[fa]=fb;
		}
		memset(countl,0,sizeof countl);
		int ans=0;
		for(int i=0;i<n;i++)
		{
			ans=max(ans,++countl[find(p[i])]);
		}
		cout<<ans<<"\n";
	}
}

Compiler output:
a.cc:4:12: error: reference to 'size' is ambiguous
    4 | int countl[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:3:11: note:                 'const int size'
    3 | const int size=1e5+1;
      |           ^~~~
a.cc:5:7: error: reference to 'size' is ambiguous
    5 | int p[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:3:11: note:                 'const int size'
    3 | const int size=1e5+1;
      |           ^~~~
a.cc: In function 'int find(int)':
a.cc:8:20: error: 'p' was not declared in this scope
    8 |         return (x==p[x])?x:p[x]=find(p[x]);
      |                    ^
a.cc: In function 'int main()':
a.cc:15:38: error: 'p' was not declared in this scope
   15 |                 for(int i=0;i<n;i++) p[i]=i;
      |                                      ^
a.cc:24:25: error: 'p' was not declared in this scope
   24 |                         p[fa]=fb;
      |                         ^
a.cc:26:24: error: 'countl' was not declared in this scope; did you mean 'roundl'?
   26 |                 memset(countl,0,sizeof countl);
      |                        ^~~~~~
      |                        roundl
a.cc:30:51: error: 'p' was not declared in this scope
   30 |                         ans=max(ans,++countl[find(p[i])]);
      |                                                   ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;


struct UnionFind {
    vector<int> r;

    UnionFind(int N){
        r = vector<int>(N, -1);
    }
    int root(int id){
        if(r[id] < 0 ) return id;
        return r[id] = root(r[id]);
    }
    bool unite(int x, int y){
       int rootX = root(x);
       int rootY = root(y);
       if(rootX==rootY) return false;
       if(r[rootX] > r[rootY]) swap(rootX,rootY);
       r[rootX] += r[rootY];
       r[rootY] = rootX;
       return true;
    }
    int size(int x){
        return -r[root(x)];
    }
};

int main() {
    fastIO;
    int N, M;
    cin >> N;
    cin >> M;
    UnionFind UF(N);
    for (int i = 0; i<M; i++){
        int A, B;
        cin >> A;
        cin >> B;
        A-=1; B-=1;
        Uf.unite(A,B);
    }
    int ans = 0;
    for (int i=0; i < N; i++){
        ans = max(ans, UF.size(i));
    }
    cout << *max_element(counter,counter + groupNum + 1);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:9: error: 'Uf' was not declared in this scope; did you mean 'UF'?
   43 |         Uf.unite(A,B);
      |         ^~
      |         UF
a.cc:49:26: error: 'counter' was not declared in this scope
   49 |     cout << *max_element(counter,counter + groupNum + 1);
      |                          ^~~~~~~
a.cc:49:44: error: 'groupNum' was not declared in this scope
   49 |     cout << *max_element(counter,counter + groupNum + 1);
      |                                            ^~~~~~~~
Language: C++

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

vector<vector<int>> friend_list={};

int find_friend(int first,int second){
    for(int i=0;i<(int)friend_list.size();i++){
        for(int j=0;j<(int)friend_list[i].size();j++){
            if(friend_list[i][j]==first){
                friend_list[i].emplace_back(second);
                return 0;
            }
            else if(friend_list[i][j]==second){
                friend_list[i].emplace_back(first);
                return 0;
            }
        }
    }
    int friend_list_len=(int)friend_list.size();
    friend_list.emplace_back({first,second});
    return 0;
}

int main(){
    int people_amount,iter;
    cin>>people_amount>>iter;
    
    for(int i=0;i<iter;i++){
        int first,second;
        cin>>first>>second;
        find_friend(first,second);
    }
    cout<<friend_list.size();
    return 0;
}


Compiler output:
a.cc: In function 'int find_friend(int, int)':
a.cc:21:29: error: no matching function for call to 'std::vector<std::vector<int> >::emplace_back(<brace-enclosed initializer list>)'
   21 |     friend_list.emplace_back({first,second});
      |     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:111:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {}; _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&]'
  111 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:111:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

vector<vector<int>> friend_list={};

int find_friend(int first,int second){
    for(int i=0;i<(int)friend_list.size();i++){
        for(int j=0;j<(int)friend_list[i].size();j++){
            if(friend_list[i][j]==first){
                friend_list[i].emplace_back(second);
                return 0;
            }
            else if(friend_list[i][j]==second){
                friend_list[i].emplace_back(first);
                return 0;
            }
        }
    }
    int friend_list_len=(int)friend_list.size();
    friend_list.emplace_back({});
    friend_list[friend_list_len].emplace_back(first);
    friend_list[friend_list_len].emplace_back(second);
    return 0;
}

int main(){
    int people_amount,iter;
    cin>>people_amount>>iter;
    
    for(int i=0;i<iter;i++){
        int first,second;
        cin>>first>>second;
        find_friend(first,second);
    }
    cout<<friend_list.size();
    return 0;
}


Compiler output:
a.cc: In function 'int find_friend(int, int)':
a.cc:21:29: error: no matching function for call to 'std::vector<std::vector<int> >::emplace_back(<brace-enclosed initializer list>)'
   21 |     friend_list.emplace_back({});
      |     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:111:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {}; _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&]'
  111 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:111:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

vector<vector<int>> friend_list={};

int find_friend(int first,int second){
    for(int i=0;i<(int)friend_list.size();i++){
        for(int j=0;j<(int)friend_list[i].size();j++){
            if(friend_list[i][j]==first){
                friend_list[i].emplace_back(second);
                return 0;
            }
            else if(friend_list[i][j]==second){
                friend_list[i].emplace_back(first);
                return 0;
            }
        }
    }
    int friend_list_len=(int)friend_list[i].size();
    friend_list.emplace_back({});
    friend_list[friend_list_len].emplace_back(first);
    friend_list[friend_list_len].emplace_back(second);
}

int main(){
    int people_amount,iter;
    cin>>people_amount>>iter;
    
    for(int i=0;i<iter;i++){
        int first,second;
        cin>>first>>second;
        find_friend(first,second);
    }
    cout<<friend_list.size();
    return 0;
}


Compiler output:
a.cc: In function 'int find_friend(int, int)':
a.cc:20:42: error: 'i' was not declared in this scope
   20 |     int friend_list_len=(int)friend_list[i].size();
      |                                          ^
a.cc:21:29: error: no matching function for call to 'std::vector<std::vector<int> >::emplace_back(<brace-enclosed initializer list>)'
   21 |     friend_list.emplace_back({});
      |     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:111:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {}; _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&]'
  111 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:111:7: note:   candidate expects 0 arguments, 1 provided
a.cc:23:46: warning: control reaches end of non-void function [-Wreturn-type]
   23 |     friend_list[friend_list_len].emplace_back(second);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

vector<vector<int>> friend_list={};
int main(){
    int people_amount,iter;
    cin>>people_amount>>iter;
    
    for(int i=0;i<iter;i++){
        int first,second;
        cin>>first>>second;
        find_friend(first,second);
    }
    cout<<friend_list.size();
    return 0;
}
int find_friend(int first,int second){
    for(int i=0;i<(int)friend_list.size();i++){
        for(int j=0;j<(int)friend_list[i].size();j++){
            if(friend_list[i][j]==first){
                friend_list[i].emplace_back(second);
                return 0;
            }
            else if(friend_list[i][j]==second){
                friend_list[i].emplace_back(first);
                return 0;
            }
        }
    }
    int friend_list_len=(int)friend_list[i].size();
    friend_list.emplace_back({})
    friend_list[friend_list_len].emplace_back(first);
    friend_list[friend_list_len].emplace_back(second);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'find_friend' was not declared in this scope
   13 |         find_friend(first,second);
      |         ^~~~~~~~~~~
a.cc: In function 'int find_friend(int, int)':
a.cc:31:42: error: 'i' was not declared in this scope
   31 |     int friend_list_len=(int)friend_list[i].size();
      |                                          ^
a.cc:32:29: error: no matching function for call to 'std::vector<std::vector<int> >::emplace_back(<brace-enclosed initializer list>)'
   32 |     friend_list.emplace_back({})
      |     ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:111:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {}; _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; reference = std::vector<int>&]'
  111 |       vector<_Tp, _Alloc>::
      |       ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:111:7: note:   candidate expects 0 arguments, 1 provided
a.cc:34:46: warning: control reaches end of non-void function [-Wreturn-type]
   34 |     friend_list[friend_list_len].emplace_back(second);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using st = string;
using P = pair<int, int>;
#define mrep(i, m, n) for(int i = m; i < n; i++)
#define rep(i, n) mrep(i, 0, n)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

typedef struct {
    vector<int> d;
    UnionFind(int n = 0): d(n, -1) {}
    int find(int x) {
        if(d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x, int y) {
        x = find(x);
        y = find(y);
        if(x == y) return false;
        if(d[x] > d[y]) swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
    int size(int x) {
        return -d[find(x)];
    }
} UnionFind;

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){
        chmax(ans, uf.size(i));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:13:5: error: ISO C++ forbids declaration of 'UnionFind' with no type [-fpermissive]
   13 |     UnionFind(int n = 0): d(n, -1) {}
      |     ^~~~~~~~~
a.cc: In member function 'int<unnamed struct>::UnionFind(int)':
a.cc:13:27: error: only constructors take member initializers
   13 |     UnionFind(int n = 0): d(n, -1) {}
      |                           ^
a.cc:13:37: warning: no return statement in function returning non-void [-Wreturn-type]
   13 |     UnionFind(int n = 0): d(n, -1) {}
      |                                     ^
a.cc: In function 'int main()':
a.cc:38:19: error: no matching function for call to 'UnionFind::UnionFind(int&)'
   38 |     UnionFind uf(n);
      |                   ^
a.cc:33:3: note: candidate: 'UnionFind::UnionFind()'
   33 | } UnionFind;
      |   ^~~~~~~~~
a.cc:33:3: note:   candidate expects 0 arguments, 1 provided
a.cc:33:3: note: candidate: 'UnionFind::UnionFind(const UnionFind&)'
a.cc:33:3: note:   no known conversion for argument 1 from 'int' to 'const UnionFind&'
a.cc:33:3: note: candidate: 'UnionFind::UnionFind(UnionFind&&)'
a.cc:33:3: note:   no known conversion for argument 1 from 'int' to 'UnionFind&&'
Language: C++

/*
	---------O7Oo7oO7O-------------
*/

#include <bits/stdc++.h>

#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std;
#define all(v) v.begin(),v.end()

const int mod = 1000 * 1000 * 1000 + 7;

const int mxN = 2e5 + 5;

int parent[mxN], sz[mxN], a[mxN];

void init()
{
	for (int i = 0; i < mxN; i++)
	{
		parent[i] = i;
		sz[i] = 1;
	}
}

int find(int v)
{
	if (v == parent[v])
		return v;
	else
		return parent[v] = find(parent[v]);
}


void Union(int a, int b)
{
	int x = find(a);
	int y = find(b);

	if (x != y)
	{
		if (sz[x] < sz[y])
			swap(x, y);

		parent[y] = x;
		sz[x] += sz[y];


	}
}
int Bin_expo(int n, int b)
{
	int res = 1;
	while (b > 0)
	{
		if (b & 1)
		{
			res = (res * n) % mod;

		}
		n = (n * n)  % mod;


		b /= 2;

	}
	return res % mod;
}


int32_t main()
{
	IOS

	int n, m;
	cin >> n >> m;
	init();
	int mx = 0;
	for (int i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		Union(a, b);

	}

	for (int i = 1; i <= n; i++)
		mx = max(mx, size[i]);

	cout << mx << "\n";



	return 0;
}




Compiler output:
a.cc: In function 'int32_t main()':
a.cc:89:34: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   89 |                 mx = max(mx, size[i]);
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
struct UnionFind {
    vector<int> par;
    UnionFind(int n) :par(n, -1) { }
    void init(int n) { par.assign(n, -1); }
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    bool connect(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    int size(int x) {
        return -par[root(x)];
    }
};
int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, m;
    cin >> n >> m;
    ll a, b;
    UnionFind uf(n);
    for(int i=0;i<m;i++){
        cin >> a >> b;
        a--;b--;
        uf.connect(a, b);
    }
    ll ans = 0;
    for(int i=0;i<n;i++){
        ans = max(ans, uf.size(i));
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: no matching function for call to 'max(ll&, int)'
   43 |         ans = max(ans, uf.size(i));
      |               ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:43:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   43 |         ans = max(ans, uf.size(i));
      |               ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:43:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   43 |         ans = max(ans, uf.size(i));
      |               ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
ll MAX_N=200000;
ll par[MAX_N+1];

void init(ll N){
  for(ll i=0;i++;i<N+1)par[i]=i;
}

ll root(ll x){
  if(par[x]==x)return x;
  else{
    par[x]=root(par[x]);
    return par[x];
  }
}

bool same(ll x,ll y){
  return root(x)==root(y);
}

void unite(ll x,ll y){
  if(same(x,y))return;
  else{
    par[x]=par[y];
    return;
  }
}

int main(){
  ll N,M;
  cin>>N>>M;
  init(N);
  for(ll i=0;i<M;i++){
    ll A,B;
    cin>>A>>B;
    unite(A,B);
  }
  vector<ll> C(N+1);
  for(ll i=1;i<N+1;i++)C.at(root(i))++;
  ll ans=0;
  for(ll i=1;i<N+1;i++)ans=max(ans,C.at(i));
  cout<<ans<<endl;
}



Compiler output:
a.cc:5:13: error: size of array 'par' is not an integral constant-expression
    5 | ll par[MAX_N+1];
      |        ~~~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef int64_t ll;
MAX_N=200000;
ll par[MAX_N+1];

void init(ll N){
  for(ll i=0;i++;i<N+1)par[i]=i;
}

ll root(ll x){
  if(par[x]==x)return x;
  else{
    par[x]=root(par[x]);
    return par[x];
  }
}

bool same(ll x,ll y){
  return root(x)==root(y);
}

void unite(ll x,ll y){
  if(same(x,y))return;
  else{
    par[x]=par[y];
    return;
  }
}

int main(){
  ll N,M;
  cin>>N>>M;
  init(N);
  for(ll i=0;i<M;i++){
    ll A,B;
    cin>>A>>B;
    unite(A,B);
  }
  vector<ll> C(N+1);
  for(ll i=1;i<N+1;i++)C.at(root(i))++;
  ll ans=0;
  for(ll i=1;i<N+1;i++)ans=max(ans,C.at(i));
  cout<<ans<<endl;
}
}

Compiler output:
a.cc:4:1: error: 'MAX_N' does not name a type
    4 | MAX_N=200000;
      | ^~~~~
a.cc:5:8: error: 'MAX_N' was not declared in this scope
    5 | ll par[MAX_N+1];
      |        ^~~~~
a.cc: In function 'void init(ll)':
a.cc:8:24: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
    8 |   for(ll i=0;i++;i<N+1)par[i]=i;
      |                        ^~~
      |                        __pstl::execution::v1::par
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc: In function 'll root(ll)':
a.cc:12:6: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   12 |   if(par[x]==x)return x;
      |      ^~~
      |      __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc: In function 'void unite(ll, ll)':
a.cc:26:5: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   26 |     par[x]=par[y];
      |     ^~~
      |     __pstl::execution::v1::par
/usr/include/c++/14/pstl/execution_defs.h:43:45: note: '__pstl::execution::v1::par' declared here
   43 | _GLIBCXX17_INLINE constexpr parallel_policy par{};
      |                                             ^~~
a.cc: At global scope:
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^