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

/*                                  /   \                                                                   (Hello)//JSM//*/      
/*                                 /*****\                                                                              */
/*     Jai Shree Mataji           /       \ |\| |_| $ |-| K                                                            */
#include<vector>
#include<iostream>
#include<algorithm>                
#include<string.h>                 
#include<bits/stdc++.h>            
#include<cstring>                  
#include<map>                     
#include<cmath>                  
#include<set>
using namespace std;            
#define ll long long int        
#define ld long double
#define MOD 1000000007 
#define PI 3.1415926535897932384626433832795                                               
#define YY cout<<"YES"
#define NN cout<<"NO"
#define Yy cout<<"Yes"
#define Nn cout<<"No"
#define yy cout<<"yes"
#define nn cout<<"no"
#define EE cout<<"\n"
#define ee cout<<"\n"
#define ne cout<<"-1"
#define pb push_back 
#define fi first
#define se second
#define mkp make_pair    
#define mkt make_tuple
#define sall(v ) sort(v.begin(), v.end())      
#define all(v )  v.begin(), v.end()      
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
#define vl vector<ll>
#define vc vector<char> 
#define vll vector< pair<ll,ll> > 
#define mps map<string ,ll>
#define mpc map<char ,ll>
#define mpl map<ll, ll>
#define pr pair<ll,ll>
ll pd(ll x,ll y){if(x%y==0) return x/y;else return x/y+1;}
ll pow1(ll n,ll p){if(p==0)return 1;ll x=pow1(n, p/2);x=(x%MOD*x%MOD)%MOD;if(p%2==0) return x;else return (x*n)%MOD;}
vl v[200005];
ll vis[200005];
ll mx=1;
void dfs(ll node,ll & d)
{
	if(vis[node]==1)
	return ;
	vis[node]=1;
	d++;
	mx=max(mx,d);
	for(ll i=0;i<v[node].size();i++)
	{
		dfs(v[node][i],d);
	}
} 
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);	
	  ll tt=1;

//	   cin>>tt;
	      while(tt--)
{

	ll ans=0;
/*10 4
3 1
4 1
5 9
2 6*/
ll n,m,j,k,l,i;
cin>>n>>m;
ll a[m],b[m];
map <pr,ll> M;
fo(i,m)
{
	cin>>a[i]>>b[i];
	if(M[{a[i],b[i]}]==0)
	v[a[i]].pb(b[i]);
    if(M[{b[i],a[i]}]==0)
	v[b[i]].pb(a[i]);
	M[{a[i],b[i]}]=1;
	M[{b[i],a[i]}]=1;
}
fo(i,n)
vis[i+1]=0;
ans=0;
for(i=1;i<=n;i++)
{
	dfs(i,0);
}
cout<<mx;
ee;
	
	

}
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:94:15: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int'
   94 |         dfs(i,0);
      |               ^
a.cc:47:23: note:   initializing argument 2 of 'void dfs(long long int, long long int&)'
   47 | void dfs(ll node,ll & d)
      |                       ^
Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
// #define ll long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define f(i,j,l) for(i=j;i<l;i++)
#define smax(a,b) a=max(a,b)
// #if !defined(ONLINE_JUDGE)
// #include "debugging.h"
// #endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
// erase,insert same as normal set

// int const mod = 7340033;
// int const mod = 998244353;
long long const mod = 1e9+7;
int power(int a,int b,int m){
    int res = 1;
    while(b){
        if(b&1){
            // res = res*a;
            res = (res*a)%m;
        }
        a=(a*a)%m;
        // a%=m;
        b=b/2;
    }
    return res;
}

int inverse(int x , int m){
    return power(x,m-2,m);
}

int const N = 2e5+5;
int const inf = 2e9;

set<int> adj[N];

void dfs(int in,int p){
    vis[in] = 1;
    for(auto x:adj[in]){
        if(x == p) continue;
        if(vis[x] == 0)
        dfs(x,in);
    }
}

void solve(){  
    int i,j;
    int n,m; cin >> n >> m;
    for(i=0;i<m;i++){
        int u,v; cin >> u>>v;
        adj[u].pb(v); adj[v].pb(u);
    }
    int ans = 0;

    for(i=1;i<=n;i++){
        ans = max(ans , (int)adj[i].size() + 1);
    }

    cout<<ans<<endl;
}              

int32_t main(){
    IOS;
    int t;
    t = 1;
    // precompute();
    // cin>>t;  
    for(int tt=1;tt<=t;tt++){
        // cout << "Case #"<<tt<<": ";
        solve();
    }
    return 0;
}


/*  

*/

Compiler output:
a.cc: In function 'void dfs(long long int, long long int)':
a.cc:56:5: error: 'vis' was not declared in this scope
   56 |     vis[in] = 1;
      |     ^~~
a.cc: In function 'void solve()':
a.cc:13:12: error: 'class std::set<long long int>' has no member named 'push_back'
   13 | #define pb push_back
      |            ^~~~~~~~~
a.cc:69:16: note: in expansion of macro 'pb'
   69 |         adj[u].pb(v); adj[v].pb(u);
      |                ^~
a.cc:13:12: error: 'class std::set<long long int>' has no member named 'push_back'
   13 | #define pb push_back
      |            ^~~~~~~~~
a.cc:69:30: note: in expansion of macro 'pb'
   69 |         adj[u].pb(v); adj[v].pb(u);
      |                              ^~
Language: C++


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define INF 1000000000000
#define MOD 1000000007
#define PI 3.14159265359
#define dij priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>
typedef long long ll;
//
pair<vector<bool>,int> get_friend(vector<vector<int>> v,int n,int k, vector<bool>che){
  stack<pair<int,int>>st;
  che[k]=true;
  vector<int> ans;ans.push_back(k);
  for(auto e:v[k]){
    st.push(make_pair(k,e));
  }
  while(!st.empty()){
    auto p=st.top();st.pop();
    if(!che[p.S]){
      ans.push_back(p.S);
      che[p.S]=true;
      for(auto e:v[p.S]){
        st.push(make_pair(p.S,e));
      }
    }
  }
  
  return make_pair(che,ans.size());
}
int main(){
    //graphづくり
  int n,m;cin>>n>>m;
  vector<vector<int>> v(n);
  rep(i,m){
    int a,b;cin>>a>>b;
    a--;b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  // get_friend で得た友達集合のサイズの最大を取る
  vector<bool> che(n,false);
  //vector<vector<int>> ans;
  int ma=0;
  rep(i,n){
    
    if(!che[i]){
    for(auto e:che)cout<<e<<" ";cout<<endl;    
    //auto vv=get_friend(v,n,i,che);
    che=vv.F;
    ma=max(ma,vv.S);
    i=lower_bound(all(che),0)-che.begin()-1;
  }
  }
  
  cout<<ma<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:9: error: 'vv' was not declared in this scope; did you mean 'v'?
   54 |     che=vv.F;
      |         ^~
      |         v
Language: C++

#define _USE_MATH_DEFINES
 
#include <bits/stdc++.h>
 
using namespace std;
 
using ll = long long;
using ld = long double;
 
constexpr ll MOD = 1000000007;
 
#ifndef ONLINE_JUDGE
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " (" << x.first << " : " << x.second << ")" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "["; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "(" << obj.first << ", " << obj.second << ")"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print_sim_py(void) {cout << endl;}
template <class Head> void print_sim_py(Head&& head) {cout << head;print_sim_py();}
template <class Head, class... Tail> void print_sim_py(Head&& head, Tail&&... tail) {cout << head << " ";print_sim_py(forward<Tail>(tail)...);}
 
#define print(...) print_sim_py(__VA_ARGS__);
#else
#define print(...);
#endif

template<class T, class U>
void dfs(ll x, vector<vector<T>>& g, vector<U>& seen, function<void(void)> func=nullptr){
    for(ll i=0; i<g[x].size(); i++){
        if(g[x][i] && !seen[i]){
            seen[i] = !seen[i];
            if(func) func();
            dfs(i,g,seen,func);
        }else{
            continue;
        }
    }
}

template<class T, class U>
void dfs(ll x, vector<list<T>>& g, vector<U>& seen, function<void(void)> func=nullptr){
    for(auto& i : g[x]){
        if(!seen[i]){
            seen[i] = !seen[i];
            if(func) func();
            dfs(i,g,seen,func);
        }else{
            continue;
        }
    }
}

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
 
    ll n,m;
    ll ans=0;

    cin >> n >> m;
    
    //vector<vector<char>> f(n,vector<char>(n,0));
    vector<list<ll>> f(n);
    vector<ll> seen(n,0);

    for(ll i=0;i<m;i++){
        ll x,y;
        cin >>x>>y;
        f[x-1].push_back(y-1);
        f[y-1].push_back(x-1);
    }

    for(ll i=0; i<n; i++){
        if(!seen[i]){
            ll cnt=0;
            dfs(i,f,seen,[&](){cnt++});
            //print(i,seen, cnt)
            ans = max(ans,cnt);
        }
    }
    
    cout << ans << endl;
 
    return 0;
}



Compiler output:
a.cc: In lambda function:
a.cc:77:37: error: expected ';' before '}' token
   77 |             dfs(i,f,seen,[&](){cnt++});
      |                                     ^
      |                                     ;
Language: C++

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

int dfs(int s,vector<vector<int>> &adj,vector<int> &visited){

		visited[s]=1 ;

		ll answer=0 ;

		for(int u:adj[s]){
			if(visited[u]==0){
				answer++ ;
			}
		}

		return answer+1 ;

}


void solve(){
	
	int n,m ;
	cin>>n>>m ;

	vector<vector<int>> adj(n+1) ;
	
	map<pair<int,int>,bool> mp ;
	
	for(int i=0;i<m;i++){
		int l,r ;
		cin>>l>>r;
		//cout<<l<<r ;
		
		if(mp[make_pair(l,r)]==true || mp[make_pair(r,l)]==true){
			continue ;
		}
		else{
			mp[{l,r}]=true ;
			mp[{r,l}]=true ;
			adj[l].push_back(r) ;
			adj[r].push_back(l) ;
		}

	}

	vector<int> visited(n+1) ;

	ll mx=0 ;

	for(int i=1;i<=n;i++){
		if(visited[i]==0){
			int answer=dfs(i,adj,visited) ;
			mx=max(answer,mx) ;
		}
	}
	
	cout<<mx ;

}	

int main(){


	
	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}

Compiler output:
a.cc: In function 'void solve()':
a.cc:55:31: error: no matching function for call to 'max(int&, ll&)'
   55 |                         mx=max(answer,mx) ;
      |                            ~~~^~~~~~~~~~~
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:55:31: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   55 |                         mx=max(answer,mx) ;
      |                            ~~~^~~~~~~~~~~
/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:55:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   55 |                         mx=max(answer,mx) ;
      |                            ~~~^~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

struct UnionFine {
    vector<int> r;

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

    int root(int x){
        if(r.at(x) < 0) return x;
        return r.at(x) = root(r.at(x));
    }

    bool unite(int x, int y){
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if(r.at(x) > r.at(y)) swap(x,y);
        r.at(x) += r.at(y);
        r.at(y) = x;
        return true;
    }
    int size(int x){
        return -r.at(root(x));
    }
};

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

    UnionFind UF(N);
    for(int i=0;i<M;i++){
        int A,B;
        cin >> A >> 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 << ans << endl;
}

Compiler output:
a.cc:10:5: error: ISO C++ forbids declaration of 'UnionFind' with no type [-fpermissive]
   10 |     UnionFind(int N){
      |     ^~~~~~~~~
a.cc: In member function 'int UnionFine::UnionFind(int)':
a.cc:12:5: warning: no return statement in function returning non-void [-Wreturn-type]
   12 |     }
      |     ^
a.cc: In function 'int main()':
a.cc:37:5: error: 'UnionFind' was not declared in this scope; did you mean 'UnionFine'?
   37 |     UnionFind UF(N);
      |     ^~~~~~~~~
      |     UnionFine
a.cc:42:9: error: 'UF' was not declared in this scope
   42 |         UF.unite(A,B);
      |         ^~
a.cc:47:24: error: 'UF' was not declared in this scope
   47 |         ans = max(ans, UF.size(i));
      |                        ^~
Language: C++

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

struct UnionFind
{
    vector<int> par;
    vector<int> rank;
    vector<int> count;

    UnionFind(int n) : par(n), rank(n), count(n){
        rep(i, n)
        {
            par[i] = i;
            rank[i] = 0;
            count[i] = 0;
        }
    }

    int find(int x){
        if (par[x] == x){
            return x;
        }
        else{
            return par[x] = find(par[x]);
        }
    }

    void unite(int x, int y){
        x = find(x);
        y = find(y);
        if (x == y)
            return;

        if (rank[x] < rank[y]){
            par[x] = y;
        }
        else{
            par[y] = x;
            if (rank[x] == rank[y])
                rank[x]++;
        }
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }

    void body()
    {
        rep(i, par.size()){
            cout << par[i] << " " << rank[i] << endl;
        }
    }
    int cnt()
    {
        int ma = 0;
        rep(i, par.size()){
            count[par[i]]++;
        }
        rep(i, par.size()){
            ma = max(ma, count[par[i]]);
        }
        return (ma);
    }
};

int main()
{
    int n, m;
    cin >> n >> m;
    UnionFind uni(n);
    vector<P> p(m);
    rep(i, m){
        int x, y;
      	cin >> x >> y;
      	x--; y--;
        uni.unite(x, y);
    }
    cout << uni.cnt() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:12: error: 'P' was not declared in this scope
   75 |     vector<P> p(m);
      |            ^
a.cc:75:13: error: template argument 1 is invalid
   75 |     vector<P> p(m);
      |             ^
a.cc:75:13: error: template argument 2 is invalid
Language: C++

//! 尺卂乃卂.卂ﾌ乇乇ㄒ
#include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
//Using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Ordered_set;

#define ll              long long
#define int             long long
#define ld             long double
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define vii             vector<vi>
#define vip            vector<pii>
#define mii             map<int,int>
#define mip             map<pair<int,int>,int>
#define mic             map<char,int> 
#define all(v)          v.begin(),v.end()  
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define lb(x)           (x&(-x))
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
#define itr(it,v)          for(auto it:v)
#define show(arr,n)     for(int i=0;i<n;i++) cout<<arr[i]<<" "; cout<<"\n";
#define fi(i,n)         for(int i=0;i<n;i++)
#define fir(i,k,n)       for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ff               first 
#define ss               second
#define deb(x) cout << #x << "=" << x << endl
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define check(x) (x && cout<<"Yes\n")||(cout<<"No\n");
#define fin(s)          freopen(s,"r",stdin);  
#define fout(s)         freopen(s,"w",stdout);

const ld pi = 3.141592653589793238462643383279502884;
const int xd[]={-1,0,1,0};
const int yd[]={0,-1,0,1};
int XX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int YY[] = { -1, 0,  1, -1, 1, -1, 0, 1 };

int expo(int a,int b,int m);
int mmi(int a,int m);
void ipgraph(int m);

const int N=5*(1e5)+10;
vii adj(N);
int a[N];
int vis[N];
int maxz=0;
void  solve(){

}
void dfs(int s,int &nodes){
    vis[s]=1;
    nodes++;
    for(auto u:adj[s]){
        if(vis[u]) continue;
        dfs(u);
    }
}
int32_t main()
{
    FIO
    int n,m; cin>>n>>m;
    fi(i,n) vis[i]=0;
    ipgraph(m);
    for(int i=0;i<n;i++) adj[i].clear();
    maxz=0;
    for(int i=0;i<n;i++){
        if(vis[i]) continue;
        int curr=0;
        dfs(i,curr);
        maxz=max(maxz,curr);
    }
    cout<<maxz<<"\n";
    return 0;

}

void ipgraph(int m){
    int i, u, v;
    while(m--){
          cin>>u>>v;
         u--, v--;
    adj[u].pb(v);
    adj[v].pb(u);
    }
}
int expo(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return a;
    int val=(expo(a,b/2,m)*expo(a,b/2,m))%m;
    if(b & 1) return (val*a)%m;
    else return val;
}
int mmi(int a,int m){
    return expo(a,m-2,m);
}

Compiler output:
a.cc: In function 'void dfs(long long int, long long int&)':
a.cc:64:12: error: too few arguments to function 'void dfs(long long int, long long int&)'
   64 |         dfs(u);
      |         ~~~^~~
a.cc:59:6: note: declared here
   59 | void dfs(int s,int &nodes){
      |      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;

vector <int> ret;


vector<bool> seen;
void dfs(Graph G, int v) {
  seen[v] = true;
  for(int i = 0;i<G[v].size();i++){
    if (seen[G[v][i]]){
      continue;
    }
    ret[G[v][i]] = ret[v];
    dfs(G,G[v][i]);
  }
}




int main(){
  int N,M;
  cin>>N>>M;
  Graph G(N);
  for (int i = 0; i < M; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for(int i = 0;i<N;i++){
    ret.push_back(i);
  }


  
  
  
  seen.assign(N, false);
  dfs(G, 0);
  
  /*sort(ret.begin(),ret.end());
  int ans = 0;
  int temp = 0;
  if(ret[0] == ret[1]){
    temp++;
  }
  for(int i = 1;i<N;i++){
    if(ret[i] == ret[i-1]){
      temp++;
      ans = max(ans,temp);
    }
    else{
      temp = 0;
    }
  }*/
  cout << ans << endl;

}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:65:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   65 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={0,31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
inline int read(){
	int x=0;char ch=getchar();
	while(ch<'0'||ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x;
}
int n,m;
int a[200005];
int cnt[200005];
inline void init() {
	for(int i=1;i<=n;i++) {
		a[i]=i;
		cnt[i]=1;
	}
}
inline int get(int x) {
	if(a[x]==x) 
		return x;
	return a[x]=get(a[x]);
}
int main(){
	ios_base::sync_with_stdio(alse);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>n>>m;
	init();
	for(int i=1;i<=m;i++) {
		int u,v;
		cin>>u>>v;
		u=get(u);
		v=get(v);
		if(u!=v) {
			a[v]=u;
			cnt[u]+=cnt[v];
		}
	}
	int res=0;
	for(int i=1;i<=n;i++) {
		if(a[i]==i) {
			res=max(res,cnt[i]);
		}
	}
	cout<<res;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:35: error: 'alse' was not declared in this scope
   44 |         ios_base::sync_with_stdio(alse);
      |                                   ^~~~
Language: C++

/**
 *    Author:  Oak_limy
 *    Created: 2020-08-29 21:43:30
**/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define maxn 200010
using namespace std;
int father[maxn],a[MAXN];
int m,n,i,x,y,q;

int find(int x)//这是递归的方法
{
    if(father[x]!=x)father[x]=find(father[x]);//这是对上文的优化核心--压缩路径
    return father[x];
}
void unionn(int r1,int r2)
{
    father[r2]=r1;
}
int main()
{
    cin>>n>>m;
    for(i=1;i<=n;i++)
    father[i]=i;
    for(i=1;i<=m;i++){
        cin>>x>>y;
        if(x>y)swap(x,y);
        int r1=find(x);
        int r2=find(y);
        if(r1!=r2)unionn(r1,r2);
    }
    rp(i,1,n)a[father[i]]++;
    cout<<*max_element(a+1,a+n+1);
    return 0;
}

Compiler output:
a.cc:57:20: error: 'MAXN' was not declared in this scope
   57 | int father[maxn],a[MAXN];
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:81:14: error: 'a' was not declared in this scope
   81 |     rp(i,1,n)a[father[i]]++;
      |              ^
a.cc:82:24: error: 'a' was not declared in this scope
   82 |     cout<<*max_element(a+1,a+n+1);
      |                        ^
Language: C++

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

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

int union(int i, int j,int parent[]) 
{    
    int irep = find(i,parent);
    int x;
    int jrep = find(j,parent);
    if(ireq==jrep) x=0;
    else x=1;
    parent[irep] = jrep;
    return x;
}

int main()
{
  int n,q;
  cin>>n>>q;
  cin>>n;
  int parent[n];
  for(int i=0;i<n;i++)
  {
    parent[i]=i;
  }
  int a,b;
  int total=n,x=0;
  for(int i=0;i<q;i++)
  {
    cin>>a>>b;
    x=union(a,b,parent);
    total=total-x;
  }
  cout<<total;
  return 0;
}
  

Compiler output:
a.cc:16:10: error: expected identifier before '(' token
   16 | int union(int i, int j,int parent[])
      |          ^
a.cc:16:11: error: expected unqualified-id before 'int'
   16 | int union(int i, int j,int parent[])
      |           ^~~
a.cc:16:11: error: expected ')' before 'int'
   16 | int union(int i, int j,int parent[])
      |          ~^~~
      |           )
a.cc: In function 'int main()':
a.cc:42:7: error: expected primary-expression before 'union'
   42 |     x=union(a,b,parent);
      |       ^~~~~
Language: C++

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

int main() {
  int64_t n,m,a,b,ans;
  cin>>n>>m;
  ans=0;
vector<vector<int64_t>> data(n);
  for(int64_t i=0;i<m;i++){
  cin>>a;
    cin>>b;
    data.at(a-1).push_back(b-1);
    data.at(b-1).push_back(a-1);
  }
  vector<int64_t> vec(n);
   vector<int64_t> hin(n);
  
  for(int64_t i=0;i<n;i++){
  vec.at(i)=1000000;
  }
  for(int64_t i=0;i<n;i++){
    vector<int64_t> iti;
    if(vec.at(i)==1000000){vec.at(i)=ans;
                           hin.at(ans)++;
                           int64_t y=data.at(i).size();
      for(int64_t j=0;j<y;j++){
        if(vec.at(data.at(i).at(j))!=vec.at(i)){hin.at(ans)++;
                                                iti.push_back(data.at(i).at(j));}
      vec.at(data.at(i).at(j))=ans;}
 int64_t x=iti.size();
    for(int64_t j=0;j<x;j++){
      if(vec.at(iti.at(j))!=vec.at(i)){hin.at(vec.at(i))++;
                                       iti.push_back((j)));}
      vec.at(iti.at(j))=vec.at(i);
                                                    int64_t x=iti.size();}
                                                        ans++;
 }
    
   
  }
  sort(hin.begin(), hin.end()); // {1, 2, 2, 5}
    reverse(hin.begin(), hin.end()); 
  cout<<hin.at(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:58: error: expected ';' before ')' token
   33 |                                        iti.push_back((j)));}
      |                                                          ^
      |                                                          ;
Language: C++

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

const int N_MX = 200000, M_MX = 200000;
int n, m;
bool rel[N_MX][N_MX];
// int group[N_MX];
int g;
int num[N_MX];
int mx;

int main() {
    cin >> n >> m;
    int group[n];
    for (int i = 0; i < n; i++) group[i] = i;
    for (int i = 0; i < m; i++) {
        int a, b;
        if (a < b) group[b - 1] = group[a - 1];
        else
            group[a - 1] = group[b - 1];
    }

    sort(group, group + n);

    int count = 1;
    for (int i = 0; i < n - 1; i++) {
        if (group[i + 1] != group[i]) {
            mx = max(mx, count);
            count = 1;
        } else
            count++;
    }

    cout << mx << endl;

    return 0;
}

Compiler output:
/tmp/ccJZvPjd.o: in function `main':
a.cc:(.text+0x176): relocation truncated to fit: R_X86_64_PC32 against symbol `mx' defined in .bss section in /tmp/ccJZvPjd.o
a.cc:(.text+0x186): relocation truncated to fit: R_X86_64_PC32 against symbol `mx' defined in .bss section in /tmp/ccJZvPjd.o
a.cc:(.text+0x1b0): relocation truncated to fit: R_X86_64_PC32 against symbol `mx' defined in .bss section in /tmp/ccJZvPjd.o
collect2: error: ld returned 1 exit status
Language: C++

// C++ implementation of the above approach
#include <bits/stdc++.h>
using namespace std;
const int maxx = 100005;
vector<int> graph[maxx];
void dfs(int curr, int& cnt, int*
			visited, vector<int>& duringdfs)
{
	visited[curr] = 1;
	++cnt;
	duringdfs.push_back(curr);
	for (auto& child : graph[curr]) {
		if (visited[child] == 0) {
			dfs(child, cnt, visited, duringdfs);
		}
	}
}

void MaximumVisit(int n)
{
	int visited[maxx];
	memset(visited, 0, sizeof visited);
	int ans[maxx];
	memset(ans, 0, sizeof ans);
	vector<int> duringdfs;
	for (int i = 1; i <= n; ++i) {
		duringdfs.clear();
		int cnt = 0;
		if (visited[i] == 0) {
			cnt = 0;
			dfs(i, cnt, visited, duringdfs);
		}
		for (auto& x : duringdfs) {
			ans[x] = cnt;
		}
	} ll an=0;
	for (int i = 1; i <= n; ++i) {
		an=max(an,ans[i]);
	}
	cout <<an;
	return;
}
int main()
{
	int n,k,a,b; cin>>n>>k;
	for(int i=0;i<k;i++){
        cin >>a>>b;
        graph[a].push_back(b);
        graph[b].push_back(a);
	}
	MaximumVisit(n);
	return 0;
}


Compiler output:
a.cc: In function 'void MaximumVisit(int)':
a.cc:36:11: error: 'll' was not declared in this scope
   36 |         } ll an=0;
      |           ^~
a.cc:38:17: error: 'an' was not declared in this scope; did you mean 'ans'?
   38 |                 an=max(an,ans[i]);
      |                 ^~
      |                 ans
a.cc:40:16: error: 'an' was not declared in this scope; did you mean 'ans'?
   40 |         cout <<an;
      |                ^~
      |                ans
Language: C++

void dfs(int u, vector<vector<int> > &G, vector<bool> &vis, int& count)
{
   vis[u] = 1;
   count++;
   for (auto x : G[u])
   {
      if (!vis[x])
         dfs(x, G, vis, count);
   }
}
 
int main()
{
   
   int n, m;
   cin >> n >> m;
   vector<vector<int> > G(n + 1);
   for(int i=0;i<m;i++)
   {
      int a, b;
      cin >> a >> b;
      G[a].push_back(b);
      G[b].push_back(a);
   }
   vector<bool> vis(n + 1, false);
   vector<int>  res;
   for (int i = 1; i <= n; i++)
   {
      int count = 0;
      if (!vis[i])
      {
         dfs(i, G, vis, count);
         res.push_back(count);
      }
   }
   ll ans = 0;
   int z = *max_element(res.begin(), res.end());
   cout << z << endl;
 
   return 0;
}

Compiler output:
a.cc:1:17: error: 'vector' has not been declared
    1 | void dfs(int u, vector<vector<int> > &G, vector<bool> &vis, int& count)
      |                 ^~~~~~
a.cc:1:23: error: expected ',' or '...' before '<' token
    1 | void dfs(int u, vector<vector<int> > &G, vector<bool> &vis, int& count)
      |                       ^
a.cc: In function 'void dfs(int, int)':
a.cc:3:4: error: 'vis' was not declared in this scope
    3 |    vis[u] = 1;
      |    ^~~
a.cc:4:4: error: 'count' was not declared in this scope
    4 |    count++;
      |    ^~~~~
a.cc:5:18: error: 'G' was not declared in this scope
    5 |    for (auto x : G[u])
      |                  ^
a.cc: In function 'int main()':
a.cc:16:4: error: 'cin' was not declared in this scope
   16 |    cin >> n >> m;
      |    ^~~
a.cc:17:4: error: 'vector' was not declared in this scope
   17 |    vector<vector<int> > G(n + 1);
      |    ^~~~~~
a.cc:17:18: error: expected primary-expression before 'int'
   17 |    vector<vector<int> > G(n + 1);
      |                  ^~~
a.cc:22:7: error: 'G' was not declared in this scope
   22 |       G[a].push_back(b);
      |       ^
a.cc:25:11: error: expected primary-expression before 'bool'
   25 |    vector<bool> vis(n + 1, false);
      |           ^~~~
a.cc:26:11: error: expected primary-expression before 'int'
   26 |    vector<int>  res;
      |           ^~~
a.cc:30:12: error: 'vis' was not declared in this scope
   30 |       if (!vis[i])
      |            ^~~
a.cc:32:17: error: 'G' was not declared in this scope
   32 |          dfs(i, G, vis, count);
      |                 ^
a.cc:33:10: error: 'res' was not declared in this scope
   33 |          res.push_back(count);
      |          ^~~
a.cc:36:4: error: 'll' was not declared in this scope
   36 |    ll ans = 0;
      |    ^~
a.cc:37:25: error: 'res' was not declared in this scope
   37 |    int z = *max_element(res.begin(), res.end());
      |                         ^~~
a.cc:37:13: error: 'max_element' was not declared in this scope
   37 |    int z = *max_element(res.begin(), res.end());
      |             ^~~~~~~~~~~
a.cc:38:4: error: 'cout' was not declared in this scope
   38 |    cout << z << endl;
      |    ^~~~
a.cc:38:17: error: 'endl' was not declared in this scope
   38 |    cout << z << endl;
      |                 ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <set>

#define rep0(i, n) for (i = 0; i < n; i++)
#define rep(s, i, n) for (i = s; i < n; i++)
using namespace std;

int ans, N,M,a,b;
bool f[200001][200001];
int g[200001];
vector<pair <int, int> > p;

bool sortinrev(const pair<int,int> &a,  
               const pair<int,int> &b) 
{ 
       return (a.first < b.first); 
} 

int main()
{
    int i, j,t,count=0,m=0;
    cin >> N>>M;
    rep0(i,20001) g[i]=1;

    rep0(i, M){
        cin >>a>>b;
        if(a>b) {t=a; a=b; b=a;}
        if(!f[a][b]) {f[a][b]=true; p[count].first=a; p[count++].second=b;}
    }
     sort(p.begin(), p.end(), sortinrev); 

    rep0(i,M-count){
        a=p[i].first; b=p[i].second;
        g[a]+=g[b]; g[b]=0; ans=max(ans,g[a]);
    }

    cout <<ans<<endl;
    return 0;
}

Compiler output:
/tmp/ccSPzkQ3.o: in function `main':
a.cc:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x168): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x18d): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x1c4): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x1ff): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x21e): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x246): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x260): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x27c): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccSPzkQ3.o
a.cc:(.text+0x296): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)

const int inf = 0x3fffffff; 
const ll INF = 0x1fffffffffffffff;
const ll mod = 1e9+7;


//void solve() {
//     int n, m, row, col;
//     cin>>n>>m;
//     vector<int> v(n+1);
//     vector<vector<int>> v2(n+1, vector<int> (n+1));
//     vector <int> v1;
//     rep(i, 0, m) {
//         cin>>row>>col;
//         v2[row][col] += 1;
//         v2[col][row] += 1;
//         if (v2[row][col] == 1 && v2[col][row]==1) {
//             v[row]+=1;
//             v[col]+=1;
//         }
//     }
//     // rep(i, 0, n+1) {
//     // for(int x:v) {
//     //     cout<<x<<" ";
//     // }
//     //cout<<endl;
//     auto it1 = max_element(all(v));
//     cout<<(*it1) + 1<<endl;
//     // auto it2 = v.begin();
//     // auto it3 = it1 - it2;
//     // }
//     // cout<<(it3+1)<<endl;
// }

int main() {

    // startTime = clock();

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    // #ifndef ONLINE_JUDGE
    // // for getting input from input.txt
    // freopen("input.txt", "r", stdin);
    // // for writing output to output.txt
    // freopen("output.txt", "w", stdout);
    // #endif

    // solve();
        int n, m, row, col;
    cin>>n>>m;
    vector<int> v(n+1);
    vector<vector<int>> v2(n+1, vector<int> (n+1));
    vector <int> v1;
    rep(i, 0, m) {
        cin>>row>>col;
        v2[row][col] += 1;
        v2[col][row] += 1;
        if (v2[row][col] == 1 && v2[col][row]==1) {
            v[row]+=1;
            v[col]+=1;
        }
    }
    // rep(i, 0, n+1) {
    // for(int x:v) {
    //     cout<<x<<" ";
    // }
    //cout<<endl;
    auto it1 = max_element(all(v));
    cout<<(*it1) + 1<<endl;

    return 0;
}

Compiler output:
main.c:1:9: 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;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;++i)
#define all(v) v.begin(), v.end()
#define PI 3.141592653589793238462643383279
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
typedef long long int ll;
typedef unsigned long long ull;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
typedef pair<ll,ll> P;
const long long MOD = 1e9+7;
const ll INF = 1LL << 60;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};

//この問題UnionFindっぽくない...？グループの数をどうやって判定すればいいのかわからな～～い


// struct UnionFind
// {
//     vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
//     UnionFind(int N) : par(N)
//     { //最初は全てが根であるとして初期化
//         for (int i = 0; i < N; i++)
//             par[i] = i;
//     }
//     int 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の木を併合
//         int rx = root(x); //xの根をrx
//         int ry = root(y); //yの根をry
//         if (rx == ry)
//             return;   //xとyの根が同じ(=同じ木にある)時はそのまま
//         par[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;
//     }
// };

struct UnionFind
{
    vector<int> par, size;
    UnionFind(int x)
    {
        par.resize(x);
        size.resize(x, 1);
        for (int i = 0; i < x; i++)
        {
            par[i] = i;
        }
    }
    int find(int x)
    {
        if (par[x] == x)
            return x;
        return par[x] = find(par[x]);
    }
    bool same(int x, int y)
    {
        return find(x) == find(y);
    }
    int consize(int x)
    {
        return size[find(x)];
    }
    void unite(int x, int y)
    {
        x = find(x);
        y = find(y);
        if (x == y)
            return;
        if (size[x] < size[y])
        {
            par[x] = y;
            size[y] += size[x];
        }
        else
        {
            par[y] = x;
            size[x] += size[y];
        }
    }
};

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,b);
    }

    ll cnt


}



Compiler output:
a.cc: In function 'int main()':
a.cc:108:1: error: expected initializer before '}' token
  108 | }
      | ^
Language: C++

    int n, m, row, col;
    cin>>n>>m;
    vector<int> v(n+1);
    vector<vector<int>> v2(n+1, vector<int> (n+1));
    vector <int> v1;
    rep(i, 0, m) {
        cin>>row>>col;
        v2[row][col] += 1;
        v2[col][row] += 1;
        if (v2[row][col] == 1 && v2[col][row]==1) {
            v[row]+=1;
            v[col]+=1;
        }
    }
    // rep(i, 0, n+1) {
    // for(int x:v) {
    //     cout<<x<<" ";
    // }
    //cout<<endl;
    auto it1 = max_element(all(v));
    cout<<(*it1) + 1<<endl;

Compiler output:
a.cc:2:5: error: 'cin' does not name a type
    2 |     cin>>n>>m;
      |     ^~~
a.cc:3:5: error: 'vector' does not name a type
    3 |     vector<int> v(n+1);
      |     ^~~~~~
a.cc:4:5: error: 'vector' does not name a type
    4 |     vector<vector<int>> v2(n+1, vector<int> (n+1));
      |     ^~~~~~
a.cc:5:5: error: 'vector' does not name a type
    5 |     vector <int> v1;
      |     ^~~~~~
a.cc:6:8: error: expected constructor, destructor, or type conversion before '(' token
    6 |     rep(i, 0, m) {
      |        ^
a.cc:20:32: error: 'v' was not declared in this scope
   20 |     auto it1 = max_element(all(v));
      |                                ^
a.cc:20:28: error: 'all' was not declared in this scope
   20 |     auto it1 = max_element(all(v));
      |                            ^~~
a.cc:20:16: error: 'max_element' was not declared in this scope
   20 |     auto it1 = max_element(all(v));
      |                ^~~~~~~~~~~
a.cc:21:5: error: 'cout' does not name a type
   21 |     cout<<(*it1) + 1<<endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m);
  for(int i=0;i<m;i++){
  	cin >> a[i] >> b[i];
  }
  int pm=0;
  vector<int> c(n);
  for(int i=0;i<m;i++){
  	if(c[a[m]]==0&&c[b[m]]==0){
      pm++;
   	  c[a[m]]=pm;
      c[b[m]]=pm;
    }else if(c[a[m]]==0&&c[b[m]]!=0){
    	c[a[m]]=c[b[m]];
    }else if(c[a[m]]!=0&&c[b[m]]==0){
    	c[b[m]]=c[a[m]];
    }else if(c[a[m]]!=0&&c[b[m]]!=0){
    	for(int j=0;j<n;j++){
          c[b[m]]=c[a[m]];
        	if(c[j]==c[b[m]]){
            	c[j]=c[a[m]];
            }
        }
    }
    int ans=0;
    for(int i=0;i<m;i++){
      int count=0;
    	for(int j=0;j<n;j++){
        	if(c[j]==i){
            	count++;
            }
        }
      if(count>ans){ans=count;}
    }
  }
  cout << ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |   cout << ans;
      |           ^~~
      |           abs
Language: C++

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

int Exp(long long int exp_n,long long int exp_e, long long exp_mod);


int main(){
  int N,M,Maxf=0;
  cin >> N >> M;
  int G[N],C[N];
  for(int i=0;i<N;i++){
    G[i]=i;
    C[i]=1;
  }
  
  int a,b,A,B;
  for(int i=0;i<M;i++){
    cin >> A >> B;
    a=min(A,B)-1;
    b=max(A+B)-1;
    C[a]=C[a]+C[b];
    C[b]=0;
    if(G[a] != G[b]){
      B=G[b];
      for(int j=0;j<N;j++){
        if(G[j]==B){
          G[j]=G[a];
        }
      }
    }
    Maxf = max(Maxf,C[a]);
  }
  cout << Maxf <<endl;
}


int Exp(long long int exp_n,long long int exp_e, long long int exp_mod){
  long long int exp_o = 1;
  long long int exp_x=exp_n;
  long long int exp_tmp;
  
  while(0<exp_e){
    exp_tmp = exp_e/2;
    if(exp_e - exp_tmp*2 == 1){
      exp_o = exp_o*exp_x;
      if(exp_o>exp_mod){
        exp_o=exp_o%exp_mod;
      }
    }
    
    exp_x = exp_x*exp_x;
    if(exp_x>exp_mod){
      exp_x=exp_x%exp_mod;
    }
    exp_e = exp_tmp;
  }
  return exp_o;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: no matching function for call to 'max(int)'
   20 |     b=max(A+B)-1;
      |       ~~~^~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 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:   template argument deduction/substitution failed:
a.cc:20:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |     b=max(A+B)-1;
      |       ~~~^~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;

// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

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

    // グラフ入力受取
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        --a;--b;
        G[a].push_back(b);
    }
    
    int ans = 1;
    // 頂点 s をスタートとした探索
    rep(i,N){
        int tmp=1;
        rep(j,i){
    seen.assign(N, false); // 全頂点を「未訪問」に初期化
    dfs(G, i);
    // t に辿り着けるかどうか
    if (seen[j]) ++tmp;
    }
    ans=max(ans,tmp);
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'i' was not declared in this scope
   32 |     rep(i,N){
      |         ^
a.cc:32:5: error: 'rep' was not declared in this scope
   32 |     rep(i,N){
      |     ^~~
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <queue>
#include <utility>
using namespace std;
#define ll long long
typedef pair<int, int> P;

int compr(const void *a, const void *b)
{ //降順
    return *(int *)b - *(int *)a;
}

int main(void)
{
    int n, m;
    int ans = 0;
    int i, j, k;
    int yn = 1;
    int a, b, sw;
    P ar[200005];
    int edge[200005] = {0};

    scanf("%d%d", &n, &m);
    for (i = 0; i < m; i++)
    {
        yn = 1;
        scanf("%d%d", &a, &b);
        if (a > b)
        {
            sw = a;
            a = b;
            b = sw;
        }
        //登録済みのクエリを探索
        for (j = 0; j < ans; j++)
        {
            //firstが同じものがあったら
            if (ar[j].first == a)
            {
                //そのすべてについて探索
                for (k = j; ar[k].first == a; k++)
                {
                    //すでに登録済みのクエリなら
                    if (ar[k].second == b)
                    {
                        yn = 0;
                        break;
                    }
                }
            }
            if (yn == 0)
                break;
        }
        //未登録
        if (yn)
        {
            ar[ans].first = a;
            ar[ans].second = b;
            ans++;
        }
    }
    for (i = 0; i < ans; i++)
    {
        edge[ar[i].first]++;
        edge[ar[i].second]++;
    }
    qsort(edge, n, sizeof(int), compr);
    printf("%d\n", edge[0] + 1);
    return 0;
}

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