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

#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
int main(){
  int t,ans=0;
  cin>>t;
  int a[t];
  for(int i=0;i<t;i++){
     cin>>a[i];
  }
  for(int i=0;i<t-1;i++){
  	for(int j=i+1;j<t;j++){
  		ans=(ans + ((a[i]%mod * a[j]%mod)%mod))%mod;
  	}
  
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n {} ; cin >>n;
    vector <long long> vec ( n,0 );
    int sum {};
    for ( int & i:vec ){
        cin >> i ;
        sum+=i;
        
    }
    
    
    long long ans {};
    for ( int i {} ; i < vec.size() ; i++ ){
        sum-=vec[i];
        ans+=(sum*vec[i])%1000000007;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
    9 |     for ( int & i:vec ){
      |                   ^~~
Language: C++

#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define int long long
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
const int mod=1e9+7;
const int inv=500000004;
int n,sum;
int a[200010];
map<int,int>h;
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i],sum+=a[i],h[a[i]]++;
	int ans=0;
	for(int i=1;i<=n;i++){
		ans=(ans+a[i]*(sum-a[i])%mod)%mod;
	}
	cout<<ans*inv%mod<<endl;
	return 0;
}
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define int long long
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
const int mod=1e9+7;
const int inv=500000004;
int n,sum;
int a[200010];
map<int,int>h;
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i],sum+=a[i],h[a[i]]++;
	int ans=0;
	for(int i=1;i<=n;i++){
		ans=(ans+a[i]*(sum-a[i])%mod)%mod;
	}
	cout<<ans*inv%mod<<endl;
	return 0;
}


Compiler output:
a.cc:38:11: error: redefinition of 'const long long int mod'
   38 | const int mod=1e9+7;
      |           ^~~
a.cc:12:11: note: 'const long long int mod' previously defined here
   12 | const int mod=1e9+7;
      |           ^~~
a.cc:39:11: error: redefinition of 'const long long int inv'
   39 | const int inv=500000004;
      |           ^~~
a.cc:13:11: note: 'const long long int inv' previously defined here
   13 | const int inv=500000004;
      |           ^~~
a.cc:40:5: error: redefinition of 'long long int n'
   40 | int n,sum;
      |     ^
a.cc:14:5: note: 'long long int n' previously declared here
   14 | int n,sum;
      |     ^
a.cc:40:7: error: redefinition of 'long long int sum'
   40 | int n,sum;
      |       ^~~
a.cc:14:7: note: 'long long int sum' previously declared here
   14 | int n,sum;
      |       ^~~
a.cc:41:5: error: redefinition of 'long long int a [200010]'
   41 | int a[200010];
      |     ^
a.cc:15:5: note: 'long long int a [200010]' previously declared here
   15 | int a[200010];
      |     ^
a.cc:42:13: error: redefinition of 'std::map<long long int, long long int> h'
   42 | map<int,int>h;
      |             ^
a.cc:16:13: note: 'std::map<long long int, long long int> h' previously declared here
   16 | map<int,int>h;
      |             ^
a.cc:43:8: error: redefinition of 'int main()'
   43 | signed main(){
      |        ^~~~
a.cc:17:8: note: 'int main()' previously defined here
   17 | signed main(){
      |        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int  mod  = 1000000007;
ll findProductSum(ll A[], ll n) 
{ 
    // calculating array sum (a1 + a2  ... + an) 
    ll array_sum = 0; 
    for (ll i = 0; i < n; i++) 
        array_sum%mod = array_sum%mod + A[i]; 
  
    // calcualting square of array sum 
    // (a1 + a2 + ... + an)^2 
    ll array_sum_square%mod = array_sum%mod * array_sum%mod; 
  
    // calcualting a1^2 + a2^2 + ... + an^2 
    ll individual_square_sum = 0; 
    for (ll i = 0; i < n; i++) 
        individual_square_sum =individual_square_sum%mod + A[i]*A[i]; 
  
    // required sum is (array_sum_square - 
    // individual_square_sum) / 2 
    return (array_sum_square%mod - individual_square_sum%mod)/2; 
} 
int main()
{
	long long n;
	cin>>n;
	long long a[n],i,j,sum=0;
	for(i=0;i<n;i++)
		cin>>a[i];
	
	cout<<findProductSum(a,n)%1000000007;
}


Compiler output:
a.cc: In function 'long long int findProductSum(long long int*, long long int)':
a.cc:10:18: error: lvalue required as left operand of assignment
   10 |         array_sum%mod = array_sum%mod + A[i];
      |         ~~~~~~~~~^~~~
a.cc:14:24: error: expected initializer before '%' token
   14 |     ll array_sum_square%mod = array_sum%mod * array_sum%mod;
      |                        ^
a.cc:23:13: error: 'array_sum_square' was not declared in this scope
   23 |     return (array_sum_square%mod - individual_square_sum%mod)/2;
      |             ^~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
        int A[]=new int[N];
        
        int n;
int m;
        for(int i=0; i<N; i++){
            A[i]=sc.nextInt();
        }
        
        
        for(int k=0; k<N-1; k++){
            for(int l=k+1; l<N; l++){
                m = n + (A[k]*A[l])%1000000007;
               if(m<1000000007){
                   n=n+m;
               }else{
                   n=(n+m)%1000000007;
               }
            }
        }
        
        
        
        
        
        
        
        
          System.out.println(n);
        }
    }

Compiler output:
Main.java:17: error: variable n might not have been initialized
                m = n + (A[k]*A[l])%1000000007;
                    ^
Main.java:33: error: variable n might not have been initialized
          System.out.println(n);
                             ^
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <string>

using namespace std;



int main()
{
    int n;
    cin >> n;
    vector<int> a(n):
    const int x = 1000000007;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    int s = 0, t = 0, u = 0;
    for (int i = 0; i < n; i++)
    {
        s += a[i];
        t += a[i]*a[i];
        s %= x;
        t %= x;
    }
    u = (s - t + x) % x;
    u /= 2;
    cout << u << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: expected ',' or ';' before ':' token
   16 |     vector<int> a(n):
      |                     ^
a.cc:27:14: error: 'x' was not declared in this scope
   27 |         s %= x;
      |              ^
a.cc:30:18: error: 'x' was not declared in this scope
   30 |     u = (s - t + x) % x;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pii pair <int, int>
#define F first
#define S second
#define ll long long
#define io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define M_PI 3.14159265358979323846
const int N = 200005;
ll pre[N];
int main() {
    io;
    int n, a[N];
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        pre[i] = a[i];
        if(i) pre[i] += pre[i - 1];
    }
    ll ans = 0;
    for(int i = 0; i < n; i++){
        ans += (pre[i] - a[i]) * a[i] % mod;
        ans %= mod;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:41: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |         ans += (pre[i] - a[i]) * a[i] % mod;
      |                                         ^~~
      |                                         modf
Language: C++

//auto 関数名 = [(&:ラムダ外の引数をとる時))](引数の型1 引数名1, 引数の型2, 引数名2, ...) { 関数の処理 }; //inside main() define function. take care of };
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//   bitset<ビット数> s(tmp);
//   // (ビット列sに対する処理)
// }
// sort(配列変数.begin(), 配列変数.end());
// do {
//   // 順列に対する処理
// } while (next_permutation(配列変数.begin(), 配列変数.end()));
//const double PI = acos(-1); M_PI
// cout << fixed << setprecision(10);
#include <bits/stdc++.h>
#include <regex>
using namespace std;
using ll = int64_t;
using P = pair<int,int>;
#define _GLIBCXX_DEBUG 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end() //sort(all(vec)); ,reverse(all(vec));etc
int main(){
  int64_t n;
  cin>>n;
  vector<int64_t>a(n);
  int64_t aa;
  int64_t ans=0;
  rep(i,n){
      cin>>aa;
      a.at(i)=aa%1000000007;
      if(i>0&&i+1<n){
        ans+=(a.at(i)*a.at(j))%(1000000007);
      }
  }
  ans%=1000000007;
  cout<<ans<<endl;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:30:28: error: 'j' was not declared in this scope
   30 |         ans+=(a.at(i)*a.at(j))%(1000000007);
      |                            ^
Language: C++

int main(){
    ll n; cin >> n;
    vector<ll> A(n);

    ll ans = 0, res = 0;
    rep(i, n) {
        cin >> A[i];
        res += A[i];
    }

    
    rep(i, n){
        res -= A[i];
        ll tmp = res % MOD;
        ans += tmp * A[i];
        ans %= MOD;
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'll' was not declared in this scope
    2 |     ll n; cin >> n;
      |     ^~
a.cc:2:11: error: 'cin' was not declared in this scope
    2 |     ll n; cin >> n;
      |           ^~~
a.cc:2:18: error: 'n' was not declared in this scope
    2 |     ll n; cin >> n;
      |                  ^
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<ll> A(n);
      |     ^~~~~~
a.cc:3:16: error: 'A' was not declared in this scope
    3 |     vector<ll> A(n);
      |                ^
a.cc:5:7: error: expected ';' before 'ans'
    5 |     ll ans = 0, res = 0;
      |       ^~~~
      |       ;
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     rep(i, n) {
      |         ^
a.cc:6:5: error: 'rep' was not declared in this scope
    6 |     rep(i, n) {
      |     ^~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << ans << endl;
      |     ^~~~
a.cc:19:13: error: 'ans' was not declared in this scope
   19 |     cout << ans << endl;
      |             ^~~
a.cc:19:20: error: 'endl' was not declared in this scope
   19 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;

int A[200200], sum[200200];

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n; cin>>n;
    for (int i=1; i<=n; i++) cin>>A[i];
    for (int i=1; i<=n; i++) sum[i] = sum[i-1] + A[i];
    int res = 0;
    for (int i=1; i<n; i++) {
        res = ((sum[n] - sum[i])*A[i]%mod + res)%mod;
    }
    cout << res;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:39: error: 'mod' was not declared in this scope; did you mean 'modf'?
   18 |         res = ((sum[n] - sum[i])*A[i]%mod + res)%mod;
      |                                       ^~~
      |                                       modf
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cassert>
#include <vector>
#define all(x) x.begin() , x.end()
#define fi first
#define se second
#define pb push_back
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define ort (b+s)/2
#define y2 asrwjaelkf
#define y1 asseopirwjaelkf
#define set multiset
 
using namespace std;
 
typedef long long Lint;
typedef pair<Lint,Lint> ii;
typedef pair<int,char> ic;
typedef pair<ii,int> iii;
typedef pair<ii,ii> i4;
 
const int maxn = 1020;
const int maxm = 10000020;
const int MOd = 998244353;

int a;
string s, s2;

void solve() {
	scanf("%d",&a);
	Lint ans = 0, tot = 0;
	for(int i=0,j;i<a;i++) {
		scanf("%d",&j);
		ans += tot*j;
		tot += j;
		ans %= 1e9+7;
	}
	cout << ans << endl;
}
 
int main() {
	int n = 1;
	// scanf("%d",&n);
	while( n-- ) solve();
 
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:48:21: error: invalid operands of types 'Lint' {aka 'long long int'} and 'double' to binary 'operator%'
   48 |                 ans %= 1e9+7;
      |                 ~~~~^~~~~~~~
a.cc:48:21: note:   in evaluation of 'operator%=(Lint {aka long long int}, double)'
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (ll i=0; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;

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

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
      rep(I,N) par[i] = i;
    }

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

    void unite(int x, int y) { // xとyの木を併合
      ll rx = root(x); //xの根をrx
      ll ry = root(y); //yの根をry
      if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
      par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
   }
  
   bool same (ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す
     ll rx = root(x);
     ll ry = root(y);
     return rx == ry;
   }
  
   ll size (ll x) {
     return -r[root(x)];
   }
};

int main() {
  ll n, m;
  cin >> n >> m;
  
  UnionFind uf(n);
  
  rep(i,m) {
    ll a, b;
    cin >> a >> b;
    a--; b--;
    uf.unite(a,b);
  }
  ll ans = 0;
  rep(i,n) ans = max(uf.size(i), ans);
  cout << ans << endl;
}

Compiler output:
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:12:20: error: 'i' was not declared in this scope
   12 |       rep(I,N) par[i] = i;
      |                    ^
a.cc: In member function 'll UnionFind::size(ll)':
a.cc:34:14: error: 'r' was not declared in this scope
   34 |      return -r[root(x)];
      |              ^
Language: C++

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

class UnionFind {
    vector<int> data;
    ll num;
public:
    UnionFind(int size) : data(size, -1), num(size) { }
    bool unite(int x, int y) {//xとyの集合を統合する
        x = root(x); y = root(y);
        if (x != y) {
            if (data[y] < data[x]) swap(x, y);
            data[x] += data[y]; data[y] = x;
        }
        num -= (x != y);
        return x != y;
    }
    bool findSet(int x, int y) {//xとyが同じ集合か返す
        return root(x) == root(y);
    }
    int root(int x) {//xのルートを返す
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    ll size(int x) {//xの集合のサイズを返す
        return -data[root(x)];
    }
    ll numSet() {//集合の数を返す
        return num;
    }
};
 int main(){
ll n,m;
   cin>>n>>m;
   UnionFind uf(n);
   rep(i,m){
     ll a,b;
     cin>>a>>b;
     a--;b--;
   uf.unite(a,b));
   }
   ll ans=0;
   rep(i,n){
     ans=max(ans,uf.size(i));
   }
   cout<<ans<<endl;
}

     


Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: expected ';' before ')' token
   42 |    uf.unite(a,b));
      |                 ^
      |                 ;
Language: C++

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

class UnionFind {
    vector<int> data;
    ll num;
public:
    UnionFind(int size) : data(size, -1), num(size) { }
    bool unite(int x, int y) {//xとyの集合を統合する
        x = root(x); y = root(y);
        if (x != y) {
            if (data[y] < data[x]) swap(x, y);
            data[x] += data[y]; data[y] = x;
        }
        num -= (x != y);
        return x != y;
    }
    bool findSet(int x, int y) {//xとyが同じ集合か返す
        return root(x) == root(y);
    }
    int root(int x) {//xのルートを返す
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    ll size(int x) {//xの集合のサイズを返す
        return -data[root(x)];
    }
    ll numSet() {//集合の数を返す
        return num;
    }
};
 int main(){
ll n,m;
   cin>>n>>m;
   UnionFind uf(n);
   rep(i,m){
     ll a,b;
     cin>>a>>b;
     a--;b--;
   uf(.unite(a,b));
   }
   ll ans=0;
   rep(i,n){
     ans=max(ans,uf.size(i));
   }
   cout<<ans<<endl;
}

     


Compiler output:
a.cc: In function 'int main()':
a.cc:42:7: error: expected primary-expression before '.' token
   42 |    uf(.unite(a,b));
      |       ^
Language: Java

import java.util.Scanner;

public class Main {

	static int MOD = 1000000007;

	public static void main(String[] args) {
		exec_1_1();

	}

	public static void exec_1_1() {

		try(var sc = new Scanner(System.in)) {

			int N = sc.nextInt();

			int M = sc.nextInt();

			int[] f = new int[N];


			for(int i=0; i<N; i++) f[i]=-1;

			for(int i=0; i<M; i++) {
				int a = sc.nextInt()-1;
				int b = sc.nextInt()-1;

				if(f[a]>-1&&f[b]<0) {
					int swap = a;
					b = a;
					a = swap;
				}

				int rIdx = rootIdx(f, a);
				if(rIdx==rootIdx(f, b)) continue ;

				f[rIdx] += rootVal(f, b);
				f[b] = rIdx;
			}

			int min = 0;

			for(int i=0; i<N; i++) min = Math.min(min, f[i]);

			System.out.println(min*-1);
		}
	}

	public static void link(int[] f, int a, int b) {

			int rIdx = rootIdx(f, a);
			f[rIdx] += rootVal(f, b);
			f[b] = rIdx;
	}


	public static int rootVal(int[] f, int x) {

		if(f[x]<0)return f[x];

		return rootVal(f, f[x]);

	}
    }

Compiler output:
Main.java:35: error: cannot find symbol
				int rIdx = rootIdx(f, a);
				           ^
  symbol:   method rootIdx(int[],int)
  location: class Main
Main.java:36: error: cannot find symbol
				if(rIdx==rootIdx(f, b)) continue ;
				         ^
  symbol:   method rootIdx(int[],int)
  location: class Main
Main.java:52: error: cannot find symbol
			int rIdx = rootIdx(f, a);
			           ^
  symbol:   method rootIdx(int[],int)
  location: class Main
3 errors
Language: C++

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


class friends {
private:
	int n, m;
	int depth = 0;

	vector<set<int>> adjacencyList;
	vector<bool> seeked;

public:
	friends(int _n, int _m) {
		n = _n;
		m = _m;

		adjacencyList.resize(n + 1);
		seeked.resize(n + 1);
		for (auto e : seeked) e = false;
	}

	void setAdjList(int a, int b);
	void search(int i = 1);
	void show();
	void solve();
};

void friends::setAdjList(int a, int b) {
	adjacencyList[a].insert(b);
	adjacencyList[b].insert(a);
}

void friends::search(int i = 1) {
	for (auto e : adjacencyList[i]) {
		if (seeked[e] == true) continue;

		depth += 1;
		seeked[e] = true;
		search(e);
	}
}

void friends::show() {
	for (int i = 1; i <= n; i++) {
		cout << i << ":";
		for (auto e : adjacencyList[i]) {
			cout << " " << e;
		}
		cout << endl;
	}
}

void friends::solve() {
	//show();
	search();
	cout << depth << endl;
}


int main() {
	int n, m;
	cin >> n >> m;

	friends friends(n, m);

	int a, b;
	for (int i = 1; i <= m; i++) {
		cin >> a >> b;
		friends.setAdjList(a, b);
	}

	friends.solve();
}

Compiler output:
a.cc:34:6: error: default argument given for parameter 1 of 'void friends::search(int)' [-fpermissive]
   34 | void friends::search(int i = 1) {
      |      ^~~~~~~
a.cc:24:14: note: previous specification in 'void friends::search(int)' here
   24 |         void search(int i = 1);
      |              ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>
#include <tuple>
#include <new>

using namespace std;

#define EPS (1e-9)
#define INF (1e9)
#define MOD (ll)(1e9 + 7)
#define PI (acos(-1))
#define REP(i,a,n) for(int i=a;i<n;i++)
#define rep(i, n) REP(i,0,n)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" ; "IMPOSSIBLE")

using ll = long long int;

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll beki(ll a, ll b) {
    ll tmp = 1;
    rep(i, b) tmp *= a;
    return tmp;
}

ll modPow(ll x, ll a) {
    if (a == 1) return x;
    if (a % 2) return (x * modPow(x, a - 1)) % MOD;
    ll t = modPow(x, a / 2);
    return ((t % MOD) * (t % MOD)) % MOD;
}

ll modInv(ll x) {
    return modPow(x, MOD - 2);
}

ll modComb(ll n, ll k) {
    ll tmp = 1;
    for (int i = 0; i < k; i++) {
        tmp *= n - i;
        tmp %= MOD;
    }
    for (int i = 1; i <= k; i++) {
        tmp *= modInv(i);
        tmp %= MOD;
    }
    return tmp;
}

vector<ll> graph[200010];

//start_sumは最初の人間の番号
//返り値はグラフの要素の総和
ll bfs(ll start_num, const vector<bool>& checked) {
    ll graph_sum = 1;

    queue<ll> next_num;
    next_num.push(start_num);
    checked[start_num] = true;

    while (!next_num.empty()) {
        for (ll i = 0; i < (ll)graph[next_num.front()].size(); i++) {
            ll tmp_next_num = graph[next_num.front()][i];
            if (!checked[tmp_next_num]) {
                checked[tmp_next_num] = true;
                next_num.push(tmp_next_num);
                graph_sum++;
            }
        }
        next_num.pop();
    }
    return graph_sum;
}

int main() {

    ll N, M;
    
    vector<bool> checked(200010, false);
    
    ll ans = 0;

    cin >> N >> M;
    rep(i, M) {
        ll A, B;
        cin >> A >> B;
        graph[A].push_back(B);
        graph[B].push_back(A);
    }

    for (ll i = 1; i <= N; i++) {
        if (!checked[i]) {
            ll graph_sum = bfs(i, checked);
            ans = max(ans, graph_sum);
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'll bfs(ll, const std::vector<bool>&)':
a.cc:86:22: error: lvalue required as left operand of assignment
   86 |     checked[start_num] = true;
      |     ~~~~~~~~~~~~~~~~~^
a.cc:92:37: error: lvalue required as left operand of assignment
   92 |                 checked[tmp_next_num] = true;
      |                 ~~~~~~~~~~~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define llu unsigned long long
#define sf scanf
#define pf printf
#define pi acos(-1)
#define time_save ios_base::sync_with_stdio(false); cin.tie(NULL);

ll vis[200005],n,m,mx,cnt=0;
vector<ll>vec[200005];
void dfs(ll src)
{
    if(src>n)
        return;
    vis[src]=1;
    cnt++;
    for(ll i=0;i<vec[src].size();i++)
    {
        ll v=vec[src][i];
        if(vis[v]==0)
        {
            vis[v]=1;
            //cnt++;
            dfs(i);
        }
    }
}
int main()
{
    //time_save;
    sf("%lld%lld",&n,&m);
    ll x,y;
    for(ll i=0;i<m;i++)
    {
        sf("%lld%lld",&x,&y);
        vec[x].push_back(y);
        vec[y].push_back(x);
    }
    for(ll i=1;i<=n;i++)
    {
        cnt=0;
        if(vis[i]==0)
        {
            dfs(i);
            mx=max(mx,cnt);
        }
    }
    cout<<mx<<endl;
    return 0;
}
}


Compiler output:
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i=0; i<(n); ++i)
#define REPR(i,n,m) for (int i=(n); i>=(m); --i)
using namespace std;
using LL = long long;
using LD = long double;
using PLL = pair<long long, long long>;
using PLD = pair<long double, long double>;
using VLL = vector<long long>;
using VLD = vector<long double>;
using VPLL = vector<PLL>;
using VPLD = vector<PLD>;

const int INF = numeric_limits<int>::max();
const unsigned long long int ULLINF = numeric_limits<unsigned long long int>::max();

int main(){

	LL n, m;
    cin >> n >> m;

    VPLL p(m);
    REP(i,m) {
        LL num1, num2;
        cin >> num1 >> num2;
        p[i].first = min(num1, num2);
        p[i].second = max(num1, num2);
    }

    if (m==0) {
        cout << 1 << endl;
        return 0;
    }

    sort(p.begin(), p.end());

    VLL group(n+1,0);
    group[p[0].first] = 1;
    group[p[0].second] = 1;
    LL g = 1;
    REP(i,m) {
        // cout << p[i].first << " " << p[i].second << endl;
        if (group[p[i].first] != group[p[i].second]) {
            if (group[p[i].first] == 0 || group[p[i].second] == 0) {
                LL a = max(group[p[i].first], group[p[i].second])
                group[p[i].first] = a;
                group[p[i].second] = a;
            } else {
                LL b = min(group[p[i].first], group[p[i].second])
                group[p[i].first] = b;
                group[p[i].second] = b;
            }
        } else if (group[p[i].first] == 0 && group[p[i].second] == 0) {
            g++;
            group[p[i].first] = g;
            group[p[i].second] = g;
        }
    }

    VLL ch(g+1, 0);
    for (LL i=1; i<=n; i++) { 
        // cout << i+1 << ":" << group[i+1] << endl;
        ch[group[i]] += 1;
    }

    LL ans = 0;

    for (LL i=1; i<=g; i++) {
        // cout << i << ":" << ch[i] << endl;
        ans = max(ans, ch[i]);
    }

    cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: expected ',' or ';' before 'group'
   46 |                 group[p[i].first] = a;
      |                 ^~~~~
a.cc:50:17: error: expected ',' or ';' before 'group'
   50 |                 group[p[i].first] = b;
      |                 ^~~~~
Language: C++

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

#define FASTIO1 ios_base::sync_with_stdio(false)
#define FASTIO2 cin.tie(NULL),cout.tie(NULL)
#define count_1(p) __builtin_popcountll(p)
#define count_0(p) __builtin_ctzll(p)
#define all(x) (x).begin(),(x).end()
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second

ll power(ll x,ll y,ll p);
const ll inf=999999999;
const ll mod=1e9+7;
bool tc=false;
#define MAX 200005;

vector <ll> adj[MAX];
vector <bool> visited(MAX,false);
ll number_of_node_visited;

void dfs(ll src)
{
    visited[src]=true;
    number_of_node_visited++;
    // cout<<src<<" ";
    for(ll node:adj[src])
        if(visited[node]==false)
            dfs(node);
    // return;
}

void solve()
{
    //scan edge and vertices
    ll n,m,u,v,ans=-inf; cin>>n>>m;
    for(ll i=0;i<m;i++)
    {
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    for(ll i=1;i<=n;i++)
        if(visited[i]==false)
        {
            number_of_node_visited=0;
            dfs(i);
            ans=max(ans,number_of_node_visited);
        }
    cout<<ans;

}

int main() 
{
    FASTIO1;
    FASTIO2;
    clock_t start=clock();
    ll t=1; 
    if(tc) cin>>t;
    while(t--)
        solve();
    cerr<<fixed<<setprecision(6);
    cerr<<(double)(clock()-start)/CLOCKS_PER_SEC<<endl;
    return 0;
}

ll power(ll x,ll y,ll p)  
{  
    ll res=1; x=x%p;
    if(x==0) return 0;
    while(y>0)  
    {
        if(y&1) res=(res*x)%p;
        y=y>>1; x=(x*x)%p;  
    }
    return res;  
}  


Compiler output:
a.cc:19:19: error: expected ']' before ';' token
   19 | #define MAX 200005;
      |                   ^
a.cc:21:17: note: in expansion of macro 'MAX'
   21 | vector <ll> adj[MAX];
      |                 ^~~
a.cc:21:20: error: expected unqualified-id before ']' token
   21 | vector <ll> adj[MAX];
      |                    ^
a.cc:19:19: error: expected ')' before ';' token
   19 | #define MAX 200005;
      |                   ^
a.cc:22:23: note: in expansion of macro 'MAX'
   22 | vector <bool> visited(MAX,false);
      |                       ^~~
a.cc:22:22: note: to match this '('
   22 | vector <bool> visited(MAX,false);
      |                      ^
a.cc:22:26: error: expected unqualified-id before ',' token
   22 | vector <bool> visited(MAX,false);
      |                          ^
a.cc:22:27: error: expected unqualified-id before 'false'
   22 | vector <bool> visited(MAX,false);
      |                           ^~~~~
a.cc: In function 'void dfs(long long int)':
a.cc:30:17: error: 'adj' was not declared in this scope
   30 |     for(ll node:adj[src])
      |                 ^~~
a.cc: In function 'void solve()':
a.cc:43:9: error: 'adj' was not declared in this scope
   43 |         adj[u].pb(v);
      |         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int cnt = 0;
bool visit[200002]{};
 
void dfs(int n, vector<vector<int>> &ar){
	cnt++;
	visit[n] = 1;
	for(int x : ar[n]){
		if(!visit[x] && (int)ar[x].size()) dfs(x, ar);
	}
}

main(){
	int n,m; cin>>n>>m;
	
	vector<vector<int>> ar(n+1);
	for(int i=0; i<m; i++){
		int a,b; cin>>a>>b;
		ar[a].push_back(b);
		ar[b].push_back(a);
	}
	int ans = 0;
	for(int i=1; i<=n; i++){
		if(!visit[i] && (int)ar[i].size()){
			cnt = 0;
			dfs(i, ar);
		}
		ans = max(ans,cnt);
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'void dfs(int, std::vector<std::vector<int> >&)':
a.cc:8:9: error: reference to 'visit' is ambiguous
    8 |         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:6: note:                 'bool visit [200002]'
    4 | bool visit[200002]{};
      |      ^~~~~
a.cc:10:21: error: reference to 'visit' is ambiguous
   10 |                 if(!visit[x] && (int)ar[x].size()) dfs(x, ar);
      |                     ^~~~~
/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:6: note:                 'bool visit [200002]'
    4 | bool visit[200002]{};
      |      ^~~~~
a.cc: At global scope:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:25:21: error: reference to 'visit' is ambiguous
   25 |                 if(!visit[i] && (int)ar[i].size()){
      |                     ^~~~~
/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:6: note:                 'bool visit [200002]'
    4 | bool visit[200002]{};
      |      ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int>adj[1000001];
int vis[1000001];
int count;
void dfs(int src)
{
    count++;
    vis[src]=1;
    for(int child:adj[src])
    {   
       
        if(vis[child]==0)
        {
            dfs(child);
        }
    }
}
int main()
{
    int n,m,count,ans=-1;
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        int a,b;
        cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    for(int i=1;i<=n;i++)
    {
        if(vis[i]==0)
        {
            count=0;
            dfs(i);
            cout<<count<<" ";
            ans=max(ans,count);
        }
    }
    cout<<ans<<"\n";
    
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:8:5: error: reference to 'count' is ambiguous
    8 |     count++;
      |     ^~~~~
In file included 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/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:5:5: note:                 'int count'
    5 | int count;
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int c;
vector<vector<int>> adj(200000);
vector<bool> visit(200000, false);
void dfs(int i);

int main()
{
    int n, m;
    cin >> n >> m;
    visit.resize(n, false);
    //for (int i=0; i<n; i++) visit[i] = false;
    int x,y;
    for (int i=0; i<m; i++) {
        cin>>x>>y;
        adj[--x].push_back(--y);
        adj[y].push_back(x);
    }
    int res = 0;
    for (int i=0; i<n; i++) {
        c = 0;
        if (!visit[i]) dfs(i);
        res = max(res, c);
    }
    cout << res << '\n';
    return 0;
}

void dfs(int i)
{
    c++;
    visit[i] = true;
    for (int j : adj[i]) {
        if (!visit[j]) dfs(j);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: reference to 'visit' is ambiguous
   13 |     visit.resize(n, false);
      |     ^~~~~
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(200000, false);
      |              ^~~~~
a.cc:24:14: error: reference to 'visit' is ambiguous
   24 |         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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~
a.cc: In function 'void dfs(int)':
a.cc:34:5: error: reference to 'visit' is ambiguous
   34 |     visit[i] = true;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~
a.cc:36:14: error: reference to 'visit' is ambiguous
   36 |         if (!visit[j]) dfs(j);
      |              ^~~~~
/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(200000, false);
      |              ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int c;
vector<vector<int>> adj(200000);
vector<bool> visit(200000, false);
void dfs(int i);

int main()
{
    int n, m;
    cin >> n >> m;
    //for (int i=0; i<n; i++) visit[i] = false;
    int x,y;
    for (int i=0; i<m; i++) {
        cin>>x>>y;
        adj[--x].push_back(--y);
        adj[y].push_back(x);
    }
    int res = 0;
    for (int i=0; i<n; i++) {
        c = 0;
        if (!visit[i]) dfs(i);
        res = max(res, c);
    }
    cout << res << '\n';
    return 0;
}

void dfs(int i)
{
    c++;
    visit[i] = true;
    for (int j : adj[i]) {
        if (!visit[j]) dfs(j);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: reference to 'visit' is ambiguous
   23 |         if (!visit[i]) dfs(i);
      |              ^~~~~
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(200000, false);
      |              ^~~~~
a.cc: In function 'void dfs(int)':
a.cc:33:5: error: reference to 'visit' is ambiguous
   33 |     visit[i] = true;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~
a.cc:35:14: error: reference to 'visit' is ambiguous
   35 |         if (!visit[j]) dfs(j);
      |              ^~~~~
/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(200000, false);
      |              ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int c;
vector<vector<int>> adj(200000);
vector<bool> visit(200000, false);
void dfs(int i);

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i=0; i<n; i++) visit[i] = false;
    int x,y;
    for (int i=0; i<m; i++) {
        cin>>x>>y;
        adj[--x].push_back(--y);
        adj[y].push_back(x);
    }
    int res = 0;
    for (int i=0; i<n; i++) {
        c = 0;
        if (!visit[i]) dfs(i);
        res = max(res, c);
    }
    cout << res << '\n';
    return 0;
}

void dfs(int i)
{
    c++;
    visit[i] = true;
    for (int j : adj[i]) {
        if (!visit[j]) dfs(j);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: reference to 'visit' is ambiguous
   13 |     for (int i=0; i<n; i++) visit[i] = false;
      |                             ^~~~~
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(200000, false);
      |              ^~~~~
a.cc:23:14: error: reference to 'visit' is ambiguous
   23 |         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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~
a.cc: In function 'void dfs(int)':
a.cc:33:5: error: reference to 'visit' is ambiguous
   33 |     visit[i] = true;
      |     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~
a.cc:35:14: error: reference to 'visit' is ambiguous
   35 |         if (!visit[j]) dfs(j);
      |              ^~~~~
/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(200000, false);
      |              ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int c;
vector<vector<int>> adj(200000);
bool visit[200000];
void dfs(int i)
{
    c++;
    visit[i] = true;
    for (int j : adj[i]) {
        if (!visit[j]) dfs(j);
    }
}
int main()
{
    int n, m;
    cin >> n >> m;
    for (int i=0; i<n; i++) visit[i] = false;
    int x,y;
    for (int i=0; i<m; i++) {
        cin>>x>>y;
        adj[--x].push_back(--y);
        adj[y].push_back(x);
    }
    int res = 0;
    for (int i=0; i<n; i++) {
        c = 0;
        if (!visit[i]) dfs(i);
        res = max(res, c);
    }
    cout << res << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:10:5: error: reference to 'visit' is ambiguous
   10 |     visit[i] = 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:6: note:                 'bool visit [200000]'
    6 | bool visit[200000];
      |      ^~~~~
a.cc:12:14: error: reference to 'visit' is ambiguous
   12 |         if (!visit[j]) dfs(j);
      |              ^~~~~
/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:6: note:                 'bool visit [200000]'
    6 | bool visit[200000];
      |      ^~~~~
a.cc: In function 'int main()':
a.cc:19:29: error: reference to 'visit' is ambiguous
   19 |     for (int i=0; i<n; i++) 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:6: note:                 'bool visit [200000]'
    6 | bool visit[200000];
      |      ^~~~~
a.cc:29:14: error: reference to 'visit' is ambiguous
   29 |         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:6:6: note:                 'bool visit [200000]'
    6 | bool visit[200000];
      |      ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int c;
vector<vector<int>> adj(200000);
vector<bool> visit(200000, false);
void dfs(int i)
{
    c++;
    visit[i] = true;
    for (int j : adj[i]) {
        if (!visit[j]) dfs(j);
    }
}
int main()
{
    int n, m;
    cin >> n >> m;
    
    int x,y;
    for (int i=0; i<m; i++) {
        cin>>x>>y;
        adj[--x].push_back(--y);
        adj[y].push_back(x);
    }
    int res = 0;
    for (int i=0; i<n; i++) {
        c = 0;
        if (!visit[i]) dfs(i);
        res = max(res, c);
    }
    cout << res << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:10:5: error: reference to 'visit' is ambiguous
   10 |     visit[i] = 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(200000, false);
      |              ^~~~~
a.cc:12:14: error: reference to 'visit' is ambiguous
   12 |         if (!visit[j]) dfs(j);
      |              ^~~~~
/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(200000, false);
      |              ^~~~~
a.cc: In function 'int main()':
a.cc:29:14: error: reference to 'visit' is ambiguous
   29 |         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:6:14: note:                 'std::vector<bool> visit'
    6 | vector<bool> visit(200000, false);
      |              ^~~~~