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

#include<bits/stdc++.h>
using namespace std;
 
#define rep(i, a, n) for(int i=a; i<n; i++)
#define ll long long
#define all(x) begin(x), end(x)
#define toInt(x) (x - '0')
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define int long long
const int inf = 1 << 30;
#define INF 1e+9
#define MAX_V 100008
const int MOD = 1e9 + 7;

void dfs(vector<vector<int>> G, vector<int> & seen, int v, int n, vector<int> & gn){
  seen[v] = n;
  gn[n]++;
  for (auto nv: G[v]){
    if(seen[nv] != -1) continue;
    dfs(G, seen, nv, n, gn);
  }
}


signed main(){
  int N, M, K;
  cin >> N >> M >> K;
  vector<vector<int>> Block(N);
  vector<vector<int>> Friends(N);
  vector<int> group(N, -1);

  for (int i=0; i<M; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    Friends[a].push_back(b);
    Friends[b].push_back(a);
  }

  int count = 0;
  vector<int> group_num(100005, 0);
  for (int v=0; v<N; v++){
    if(group[v] != -1) return;
    dfs(Friends, group, v, count, group_num);
    count++;
  }
  // cout << count << endl;
  // vector<int> group_friend(count-1);
  // vector<int> group_block(count-1);

  
  // for (int i=0; i<N; i++){
  //   group_num[group[i]]++;
  //   // group_friend[group[i]] += (Friends[i].size());
  //   // group_block[group[i]] += (Block[i].size());
  // }

  vector<int> ans(N);
   for (int i=0; i<N; i++){
    ans[i] = group_num[group[i]] - Friends[i].size() - 1;
  }

  // for (auto it: ans){ cout << it << endl;}
  for (int i=0; i<K; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    if(group[a] == group[b]){
      ans[a]--;
      ans[b]--;
    }
  }
  for (auto it: ans){ cout << it << endl;}
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:24: error: return-statement with no value, in function returning 'int' [-fpermissive]
   44 |     if(group[v] != -1) return;
      |                        ^~~~~~
Language: C++

/**
*	created: 10.08.2020 14:57:14
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,s,n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pcnt(bit) __builtin_popcountll(bit)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (b < a) {a = b; return 1;} return 0;}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dx2[8] = {0, 1, 0, -1, 1, 1,-1, -1};
const int dy2[8] = {1, 0,-1, 0, 1, -1, 1, -1};
const long double pi = acos(-1.0);
const int MAX = 1000010;
const int INF = 1LL << 60;
const int MOD = 1000000007;
// const int MOD = 998244353;

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

signed main() {

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

    int dir[MAX];
    int n, m, k; cin >> n >> m >> k;
    UnionFind uf(n);
    rep(i,m) {
        int a, b; cin >> a >> b;
        a--; b--;
        dir[a]++; dir[b]++;
        uf.unite(a,b);
    }
    vector<int> to[MAX];
    rep(i,k) {
        int a, b; cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    rep(i,n) {
        int ans = uf.size(i) - 1 - dir[i];
        for (int p : to[i]) if (uf.same(i,p)) ans--;
        if (i == 0) cout << ans;
        else cout << ans << ' ';
    }
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In member function 'bool UnionFind::unite(long long int, long long int)':
a.cc:38:9: error: expected ';' before 'par'
   38 |         par[rx] += par[ry]; par[rx] = ry;
      |         ^~~
Language: C++

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

struct UnionFind {
    vector<int> par;
    map<int,int> num; 
    UnionFind(int N) : par(N) { 
        for(int i = 0; i < N; i++) par[i] = i;
    }
    int root(int x) { 
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
    void unite(int x, int y) { 
        int rx = root(x); 
        int ry = root(y); 
        if (rx == ry) return; 
        par[rx] = ry; 
    }
    void reset(int n){ 
        for(int i=0;i<n;i++)par[i] = root(par[i]);
    }
    bool con(int x,int y){
        return par[x]==par[y];
    }
    void solve(int n){
        for(int j=0;j<n;j++)num[par[j]]++;
    }
    int solve(int i){
        return (num[par[i]]-1);
    }
};
int main(){
    int n,m,k;
    cin >> n >> m >> k;
    UnionFind tree(n);
    int a,b;
    vector<int> v[n];
    for(int i=0;i<m;i++){
        cin >> a >> b;
        a--; b--;
        tree.unite(a,b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    tree.reset(n);
    for(int i=0;i<k;i++){
        int c,d;
        cin >> c >> d;
        c--; d--;
        if(tree.con(c,d)){
            v[c].push_back(d);
            v[d].push_back(c);
        }
    }
    for(int i=0;i<n;i++)cout << tree.solve(i)-(int)v[i].size() << " ";
}

Compiler output:
a.cc:29:9: error: 'int UnionFind::solve(int)' cannot be overloaded with 'void UnionFind::solve(int)'
   29 |     int solve(int i){
      |         ^~~~~
a.cc:26:10: note: previous declaration 'void UnionFind::solve(int)'
   26 |     void solve(int n){
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:56:46: error: invalid operands of types 'void' and 'int' to binary 'operator-'
   56 |     for(int i=0;i<n;i++)cout << tree.solve(i)-(int)v[i].size() << " ";
      |                                 ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                           |   |
      |                                           |   int
      |                                           void
Language: C++

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

struct UnionFind {
    vector<int> par; 
    UnionFind(int N) : par(N) { 
        for(int i = 0; i < N; i++) par[i] = i;
    }
    int root(int x) { 
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
    void unite(int x, int y) { 
        int rx = root(x); 
        int ry = root(y); 
        if (rx == ry) return; 
        par[rx] = ry; 
    }
    void reset(int n){ 
        for(int i=0;i<n;i++)par[i] = root(par[i]);
    }
    bool con(int x,int y){
        return par[x]==par[y];
    }
    int solve(int i){
        int ans=0;
        for(int j=0;j<n;j++)if(par[i]==par[j] && i!=j)ans++;
        return ans;
    }
};
int main(){
    int n,m,k;
    cin >> n >> m >> k;
    UnionFind tree(n);
    int a,b;
    vector<int> ng[n];
    for(int i=0;i<m;i++){
        cin >> a >> b;
        a--; b--;
        tree.unite(a,b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    tree.reset(n);
    for(int i=0;i<k;i++){
        int c,d;
        cin >> c >> d;
        c--; d--;
        if(tree.con(c,d)){
            v[c].push_back(d);
            v[d].push_back(c);
        }
    }
    for(int i=0;i<n;i++)cout << solve(i)-(int)v[i].size() << " ";
}

Compiler output:
a.cc: In member function 'int UnionFind::solve(int)':
a.cc:27:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |         for(int j=0;j<n;j++)if(par[i]==par[j] && i!=j)ans++;
      |                       ^
      |                       yn
a.cc: In function 'int main()':
a.cc:41:9: error: 'v' was not declared in this scope
   41 |         v[a].push_back(b);
      |         ^
a.cc:50:13: error: 'v' was not declared in this scope
   50 |             v[c].push_back(d);
      |             ^
a.cc:54:33: error: 'solve' was not declared in this scope
   54 |     for(int i=0;i<n;i++)cout << solve(i)-(int)v[i].size() << " ";
      |                                 ^~~~~
a.cc:54:47: error: 'v' was not declared in this scope
   54 |     for(int i=0;i<n;i++)cout << solve(i)-(int)v[i].size() << " ";
      |                                               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	int n, m, k;
	cin >> n >> m >> k;
	v2 c(n+1, v1(0));
	vector<pair<int, int>> frend(0);
	vector<pair<int, int>> block(0);
	rep(i, m){
		int x, y;
		cin >> x >> y;
		c[x].push_back(y);
		c[y].push_back(x);
		frend.push_back(make_pair(x,y));
	}
	rep(i, k){
		int x, y;
		cin >> x >> y;
		block.push_back(make_pair(x, y));
	}
	rep(i, n){
		c[i].push_back(1e8);
	}
	v1 color(n+1, 0);//0が未訪問-1は保留
	v1 ColorSize(n, 0);
	queue<int> Q;
	for(int i = 1; i <=n; i++){
		if(color[i] != 0) continue;
		Q.push(i);
		while(!Q.empty()){
			int u = Q.front();
			int g = c[u].size();
			for(int i = 0; i < g; i++){
				if(c[u][j] == 1e8) break;
				if(color[c[u][j]] == 0){
					color[c[u][j]] = -1;
					Q.push(c[u][j]);
				}
			}
			color[u] = i;
			ColorSize[i]++;
			Q.pop();
		}
	}
	v1 fr(n+1);
	for(int i = 1; i<=n; i++){
		fr[i] = ColorSize[color[i]];
	}
	for(int i = 0; i<m; i++){
		int x = frend[i].first;
		int y = frend[i].second;
		if(color[x] == color[y]){
			fr[x]--;
			fr[y]--;
		}
	}
	rep(i, k){
		int x = block[i].first;
		int y = block[i].second;
		if(color[x] == color[y]){
			fr[x]--;
			fr[y]--;
		}
	}
	for(int i = 1; i<=n; i++){
		cout << fr[i]-1 <<" ";
	}
	cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:41: error: 'j' was not declared in this scope
   42 |                                 if(c[u][j] == 1e8) break;
      |                                         ^
a.cc:43:47: error: 'j' was not declared in this scope
   43 |                                 if(color[c[u][j]] == 0){
      |                                               ^
Language: C++

#include<iostream>
using namespace std;

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

int deg[100005];
vector<int> to[1000005];

int main(){
  int n,m,k;
  cin>>n>>m>>k;
  Unionfind uf(n);
  for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    a--;
    b--;
    deg[a]++;
    deg[b]++;
    uf.unite(a,b);
  }
  for(int i=0;i<k;i++){
    int a,b;
    cin>>a>>b;
    a--;
    b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  for(int i=0;i<n;i++){
    int ans=uf.size(i)-1-deg[i];
    for(int u:to[i]){
      if(uf.same(i,u)) ans--;
    }
    printf("%d%c",ans,i==n-1?'\n':' ');
  }
  return 0;
}

Compiler output:
a.cc:5:3: error: 'vector' does not name a type
    5 |   vector<int> d;
      |   ^~~~~~
a.cc: In constructor 'Unionfind::Unionfind(int)':
a.cc:6:21: error: class 'Unionfind' does not have any field named 'd'
    6 |   Unionfind(int n): d(n,-1){}
      |                     ^
a.cc: In member function 'int Unionfind::root(int)':
a.cc:8:8: error: 'd' was not declared in this scope
    8 |     if(d[x]<0) return x;
      |        ^
a.cc:9:12: error: 'd' was not declared in this scope
    9 |     return d[x]=root(d[x]);
      |            ^
a.cc: In member function 'bool Unionfind::unite(int, int)':
a.cc:15:8: error: 'd' was not declared in this scope
   15 |     if(d[x]>d[y]) swap(x,y);
      |        ^
a.cc:16:5: error: 'd' was not declared in this scope
   16 |     d[x]+=d[y];
      |     ^
a.cc: In member function 'int Unionfind::size(int)':
a.cc:21:27: error: 'd' was not declared in this scope
   21 |   int size(int x){return -d[root(x)];}
      |                           ^
a.cc: At global scope:
a.cc:25:1: error: 'vector' does not name a type
   25 | vector<int> to[1000005];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:45:5: error: 'to' was not declared in this scope; did you mean 'tm'?
   45 |     to[a].push_back(b);
      |     ^~
      |     tm
a.cc:50:15: error: 'to' was not declared in this scope; did you mean 'tm'?
   50 |     for(int u:to[i]){
      |               ^~
      |               tm
Language: C++

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

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

int deg[100005];
vector<int> to[100005];

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        --a; --b;
        deg[a]++;
        deg[b]++;
        uf.unite(a, b);
    } 
    for(int i = 0; i < k; i++){
        int a, b;
        cin >> a >> b;
        --a; --b;
        to[a].push_back(a);
        to[b].push_back(b);
    }
    for(in ti = 0; i < n; i++){
        int ans = uf.size(i) - 1 - deg[i];
        for(int u : to[i]){
            if(uf.same(i, u)) --ans;
        }
        printf("%d%c", ans, i == n - 1 ? '\n' : ' ');
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:9: error: 'in' was not declared in this scope; did you mean 'n'?
   48 |     for(in ti = 0; i < n; i++){
      |         ^~
      |         n
a.cc:48:20: error: 'i' was not declared in this scope
   48 |     for(in ti = 0; i < n; i++){
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vll = vector<vl>;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define RES(a, n) (a).resize(n)
ll n, m, k;
vl a, b, c, d;
class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }

    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }

    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

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

    ll size(ll x) {
        return siz[root(x)];
    }
};

int solve() {
	cin >> n >> m >> k;
	UnionFind friends(n);
	vll fr(n);
	vll bl(n);
	RES(a, m);
	RES(b, m);
	RES(c, k);
	RES(d, k);
	REP(i, m){
		cin >> a[i] >> b[i];
		friends.merge(a[i]-1, b[i]-1);
		fr[a[i]-1].push_back(b[i]-1);
		fr[b[i]-1].push_back(a[i]-1);
	}
	REP(i, k){
		cin >> c[i] >> d[i];
		if(friends.issame(c[i]-1, d[i]-1)){
			bl[c[i]-1].push_back(d[i]-1);
			bl[d[i]-1].push_back(c[i]-1);
		}
	}
	REP(i, n){
		cout << friends.size(i) - 1 - bl[i].size() - fr[i].size() << " ";
	}
	cout << endl;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
 
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<long long int,long long int>
#define vi vector<long long int>
#define vll vector<ll>
#define vii vector<ii>
#define debug cout << "Ok" << endl;

using namespace std;
long long int group[100010];
bitset<100010>verified;
vector<long long long long int>val;
vector<vector<long long int>>f(100010);
vector<vector<long long int>>b(100010);

void dfs(long long int i, long long int gr){
	if(verified[i]==true) return;
	verified[i]=true;
	val[gr]++;
	group[i] = gr;

	for(long long int j=0;j<f[i].size();j++){
		dfs(f[i][j], gr);
	}


	return;
}



int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	long long int n,m,k,a,c;

	cin >> n >> m >> k;

	while(m--){
		cin >> a >> c;
		f[a].push_back(c);
		f[c].push_back(a);
	}

	while(k--){
		cin >> a >> c;
		b[a].push_back(c);
		b[c].push_back(a);
	}

	long long int cont=0;
	for(long long int i=1;i<n;i++){
		if(verified[i]==false){
			val.push_back(0);
			dfs(i,cont);
			cont++;
		}
	}

	for(long long int i=1;i<=n;i++){
		cont = val[group[i]] - f[i].size();
		long long int g = group[i];

		for(long long int j=0;j<b[i].size();j++){
			if(g == group[b[i][j]])
				cont--;
		}

		cout << cont-1 << (i==n ? "\n": " ");
	}

	return 0;
}

Compiler output:
a.cc:17:18: error: 'long long long' is too long for GCC
   17 | vector<long long long long int>val;
      |                  ^~~~
a.cc:17:23: error: 'long long long' is too long for GCC
   17 | vector<long long long long int>val;
      |                       ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	int n, m, k;
	cin >> n >> m >> k;
	vector<vector<int>> G(n);
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		G[a-1].push_back(b-1);
		G[b-1].push_back(a-1);
	}
	vector<vector<int>> B(n);
	for (int i = 0; i < k; i++) {
		int c, d;
		cin >> c >> d;
		B[c-1].push_back(d-1);
		B[d-1].push_back(c-1);
	}




	bool visited[n];
	fill(visited, visited+n, false);
	set<int> todo;
	for (int i = 0; i < n; i++)
		todo.insert(i);

	queue<int> q;
	int visit_count = 0;

	vector<set<int>> groups;
	vector<int> groups_number(n);

	while (!todo.empty()) {
		auto it = todo.begin();
		q.push(*it);
		groups.resize(groups.size()+1);
		while (!q.empty()) {
			int v = q.front();
			q.pop();
			if (visited[v] == false) {
				todo.erase(v);
				groups.back().insert(v);
				groups_number[v] = groups.size()-1;
				visited[v] = true;
				visit_count++;
				for (int e : G[v]) {
					if (visited[e] == false)
						q.push(e);
				}
			}
		}
	}

	for (int i = 0; i < n; i++) {
		//set<int> g = groups[groups_number[i]];
		for (int j = 0; j < G[i].size(); j++) {
			//g.erase(G[i][j]);
		}
		for (int j = 0; j < B[i].size(); j++) {
			//g.erase(B[i][j]);
		}
		cout << g.size() - 1;
		if (i < n-1)
			cout << " ";
		else
			cout << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:25: error: 'g' was not declared in this scope
   68 |                 cout << g.size() - 1;
      |                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
vector<int>AB[100005];
vector<int>CD[100005];
void dfs(vector<bool> ok,set<int> &Set,int now) {
    Set.insert(now);
    for(int i = 0; i < AB[now].size(); i++) {
        if(!ok[AB[now][i]]) {
            ok[AB[now][i]] = true;
            dfs(ok,AB,Set,AB[now][i]);
            ok[AB[now][i]] = false;
        }
    }
    return;
}
signed main() {
    int N,M,K;
    cin >> N >> M >> K;
    for(int i = 0; i < M; i++) {
        int A,B;
        cin >> A >> B;
        A--;B--;
        AB[A].push_back(B);
        AB[B].push_back(A);
    }
    for(int i = 0; i < K; i++) {
        int C,D;
        cin >> C >> D;
        C--;D--;
        CD[C].push_back(D);
        CD[D].push_back(C);
    }
    for(int i = 0; i < N; i++) {
        vector<bool> ok(N,false);
        set<int>Set;
        for(int j = 0; j < CD[i].size(); j++) {
            Set.insert(CD[i][j]);
        }
        dfs(ok,Set,i);
        cout << Set.size()-AB[i].size()-1-CD[i].size();
        if(i+1 != N) {
            cout << " ";
        } 
    }
    cout << endl;
}


Compiler output:
a.cc: In function 'void dfs(std::vector<bool>, std::set<long long int>&, long long int)':
a.cc:15:20: error: invalid initialization of reference of type 'std::set<long long int>&' from expression of type 'std::vector<long long int> [100005]'
   15 |             dfs(ok,AB,Set,AB[now][i]);
      |                    ^~
a.cc:10:36: note: in passing argument 2 of 'void dfs(std::vector<bool>, std::set<long long int>&, long long int)'
   10 | void dfs(vector<bool> ok,set<int> &Set,int now) {
      |                          ~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
vector<int>AB[100005];
vector<int>CD[100005];
void dfs(vector<bool> ok,vector<vector<int>> AB,set<int> &Set,int now) {
    Set.insert(now);
    for(int i = 0; i < AB[now].size(); i++) {
        if(!ok[AB[now][i]]) {
            ok[AB[now][i]] = true;
            dfs(ok,AB,Set,AB[now][i]);
            ok[AB[now][i]] = false;
        }
    }
    return;
}
signed main() {
    int N,M,K;
    cin >> N >> M >> K;
    for(int i = 0; i < M; i++) {
        int A,B;
        cin >> A >> B;
        A--;B--;
        AB[A].push_back(B);
        AB[B].push_back(A);
    }
    for(int i = 0; i < K; i++) {
        int C,D;
        cin >> C >> D;
        C--;D--;
        CD[C].push_back(D);
        CD[D].push_back(C);
    }
    for(int i = 0; i < N; i++) {
        vector<bool> ok(N,false);
        set<int>Set;
        for(int j = 0; j < CD[i].size(); j++) {
            Set.insert(CD[i][j]);
        }
        dfs(ok,AB,Set,i);
        cout << Set.size()-AB[i].size()-1-CD[i].size();
        if(i+1 != N) {
            cout << " ";
        } 
    }
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:16: error: could not convert '(std::vector<long long int>*)(& AB)' from 'std::vector<long long int>*' to 'std::vector<std::vector<long long int> >'
   44 |         dfs(ok,AB,Set,i);
      |                ^~
      |                |
      |                std::vector<long long int>*
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
vector<int>AB[100005] = {};
vector<int>CD[100005] = {};
void dfs(vector<bool> ok,vector<vector<int>> AB,set<int> &Set,int now) {
    Set.insert(now);
    for(int i = 0; i < AB[now].size(); i++) {
        if(!ok[AB[now][i]]) {
            ok[AB[now][i]] = true;
            dfs(ok,AB,Set,AB[now][i]);
            ok[AB[now][i]] = false;
        }
    }
    return;
}
signed main() {
    int N,M,K;
    cin >> N >> M >> K;
    for(int i = 0; i < M; i++) {
        int A,B;
        cin >> A >> B;
        A--;B--;
        AB[A].push_back(B);
        AB[B].push_back(A);
    }
    for(int i = 0; i < K; i++) {
        int C,D;
        cin >> C >> D;
        C--;D--;
        CD[C].push_back(D);
        CD[D].push_back(C);
    }
    for(int i = 0; i < N; i++) {
        vector<bool> ok(N,false);
        set<int>Set;
        for(int j = 0; j < CD[i].size(); j++) {
            Set.insert(CD[i][j]);
        }
        dfs(ok,AB,Set,i);
        cout << Set.size()-AB[i].size()-1-CD[i].size();
        if(i+1 != N) {
            cout << " ";
        } 
    }
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:16: error: could not convert '(std::vector<long long int>*)(& AB)' from 'std::vector<long long int>*' to 'std::vector<std::vector<long long int> >'
   44 |         dfs(ok,AB,Set,i);
      |                ^~
      |                |
      |                std::vector<long long int>*
Language: C++

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

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

int deg[100005];//友達の人数

int main(){
    int n,m,k;cin>>n>>m>>k;
    UnionFind uf(n);
    
    rep(i,m){
        int a,b;
        cin>>a>>b;
        --a; --b;
        deg[a]++;
        deg[b]++;
        uf.unite(a,b);
    }
    rep(i,k){
        int a,b;
        cin>>a>>b;
        --a; --b;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    
    rep(i,n){
        int ans = uf.size(i)-1-deg[i];
        for(int u: to[i]){
            if(uf.same(i,u)) --ans;
        }
        printf("%d%c", ans, i==n-1?'\n':' ');
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:9: error: 'to' was not declared in this scope; did you mean 'tm'?
   43 |         to[a].push_back(b);
      |         ^~
      |         tm
a.cc:49:20: error: 'to' was not declared in this scope; did you mean 'tm'?
   49 |         for(int u: to[i]){
      |                    ^~
      |                    tm
Language: C++

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val m = sc.nextInt()
  val k = sc.nextInt()
  val uf = UnionFind(n)
  val ans = new Array[Int](n)
  for (i <- 0 until m) {
    val a = sc.nextInt() - 1
    val b = sc.nextInt() - 1
    uf.unite(a, b)
    ans(a) = ans(a) - 1
    ans(b) = ans(b) - 1
  }
  for (i <- 0 until n) {
    ans(i) = ans(i) + uf.size(i) - 1
  }
  for (i <- 0 until k) {
    val c = sc.nextInt() - 1
    val d = sc.nextInt() - 1
    if (uf.same(c, d)) {
      ans(c) = ans(c) - 1
      ans(d) = ans(d) - 1
    }
  }
  for (i <- 0 until n) {
    print(ans(i))
    if (i < n - 1) print(" ")
  }
  println()
  case class UnionFind(val n: Int) {
    val par = Array.fill(n)(-1)
    val sz = Array.fill(n)(1)
    def find(x: Int): Int = {
      if (par(x) == -1) par(x) = x
      if (par(x) != x) {
        par(x) = find(par(x))
      }
      par(x)
    }
    def unite(x: Int, y: Int): Unit = {
      val a = find(x)
      val b = find(y)
      if (a == b) return
      if (sz(a) > sz(b)) {
        sz(a) += sz(b)
        par(b) = par(a)
      } else {
        sz(b) += sz(a)
        par(a) = par(b)
      }
    }
    def same(x: Int, y: Int): Boolean = {
      find(x) == find(y)
    }
    def size(x: Int): Int = {
      sz(find(x))
    }
  }
}


Compiler output:
a.cc:1:1: error: 'object' does not name a type
    1 | object Main extends App {
      | ^~~~~~
Language: C++

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

using Graph = vector<vector<int>>;
vector<bool> seen;
vector<bool> conf;
ll cnt = 0;

Graph F(100010);
Graph B(100010);

using XXXXX = vector<vector<bool>>;
XXXXX X(100010);
int N, M, K;
void dfs(const Graph &F, int v) {
    /* 訪問済にする. */
    seen[v] = true;
    conf[v] = true;
    cnt++;
    rep (i, F[v].size()) {
        if (seen[F[v][i]] == true) continue;
        dfs(F, F[v][i]);
    }
}

signed main() {
    cin >> N >> M >> K;

    rep (i, M) {
        int a, b;
        cin >> a >> b;
        F[a-1].push_back(b-1);
        F[b-1].push_back(a-1);
    }
    rep (i, K) {
        int c, d;
        cin >> c >> d;
        B[c-1].push_back(d-1);
        B[d-1].push_back(c-1);
    }

    conf.assign(N, false);
    rep (i, N) {
        if (conf[i] == true) continue;

        cnt = 0;
        seen.assign(N, false);
        dfs(F, i);
        rep (j, B[i].size()) {
            /* 各人にメンバーリストを代入. */
            X[seen[B[i][j]]] = seen;

//        rep (j, B[i].size()) {
//            X[seen[B[i][j]]] = cnt;
//        }
//        rep (j, B[i].size()) {
//            if (seen[B[i][j]] == true) cnt--;
//        }
//       rep (j, B[i].size()) {
//            X[seen[B[i][j]]] = cnt;
//        }
    }

    rep (i, N) {
        /* メンバーリストにBlockがいたらへらす. */
        int a = X[i].size();
        rep (j, X[i].size()) {
            rep (k, K) {
                if (X[i][j] == B[i][k]) a--;
            }
        }
        cout << (a - 1 - F[i].size());
        if (i != N-1) cout << ' ';
    }
    cout << endl;

}


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

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

using Graph = vector<vector<int>>;
vector<bool> seen;
vector<bool> conf;
ll cnt = 0;

Graph F(100010);
Graph B(100010);

using XXXXX = vector<vector<bool>>;
XXXXX X(100010);
int N, M, K;
void dfs(const Graph &F, int v) {
    /* 訪問済にする. */
    seen[v] = true;
    conf[v] = true;
    cnt++;
    rep (i, F[v].size()) {
        if (seen[F[v][i]] == true) continue;
        dfs(F, F[v][i]);
    }
}

signed main() {
    cin >> N >> M >> K;

    rep (i, M) {
        int a, b;
        cin >> a >> b;
        F[a-1].push_back(b-1);
        F[b-1].push_back(a-1);
    }
    rep (i, K) {
        int c, d;
        cin >> c >> d;
        B[c-1].push_back(d-1);
        B[d-1].push_back(c-1);
    }

    conf.assign(N, false);
    rep (i, N) {
        if (conf[i] == true) continue;

        cnt = 0;
        seen.assign(N, false);
        dfs(F, i);
        rep (j, B[i].size()) {
            /* 各人にメンバーリストを代入. */
            X[seen[B[i][j]]] = seen;

//        rep (j, B[i].size()) {
//            X[seen[B[i][j]]] = cnt;
//        }
//        rep (j, B[i].size()) {
//            if (seen[B[i][j]] == true) cnt--;
//        }
//       rep (j, B[i].size()) {
//            X[seen[B[i][j]]] = cnt;
//        }
    }

    rep (i, N) {
        /* メンバーリストにBlockがいたらへらす. */
        int a = X[i].size();
        rep (j, X[i].size()) {
            rep (k, K) {
                if (X[i][j] == B[i][k]) a--;
            }
        }
        cout << (a - 1 - F[i].size());
        if (i != N-1) cout << ' ';
    }
    cout << endl;

}



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

#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;

class UnionFind{
public:
	vector<int> p;  // 親
	vector<int> sz; // サイズ
	UnionFind(int n){
		p.resize(n, -1);
		sz.resize(n, 1);
	}

	int root(int x){
		if(p[x] == -1)return x;
		else return p[x] = root(p[x]);
	}

	void unite(int x, int y){
		x = root(x);
		y = root(y);
		if(x == y)return;
		sz[y] += sz[x];
		p[x] = y;
	}

	int size(int x){ //xが属すグループのサイズ
		return sz[root(x)];
	}
	bool same(int x, int y){
		return (root(x) == root(y));
	}
};



void dfs(int now)
{

}

void solve()
{
	int n, m, k;
	cin >> n >> m >> k;
	
	UnionFind ab(n, 0);
	vector<int> fr(n);
	vector< vector<int> > cd;

	for(int i = 0; i < m; ++m)
	{
		int a, b;
		cin >> a >> b;
		--a;
		--b;
		++fr[a];
		++fr[b];
		ab.unite(a, b);
	}

	for(int i = 0; i < k; ++k)
	{
		int c, d;
		cin >> c >> d;
		--c;
		--d;

		cd[c].push_back(d);
		cd[d].push_back(c);
	}

	for(int i = 0; i < n; ++i)
	{
		int ans = ab.size(i) - fr[i] - 1;
		for(int c : cd[i])
		{
			if (ab.same(i, c))--ans;
		}
		cout << ans << " ";
	}

}

int main()
{
	fastio;
	solve();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:53:26: error: no matching function for call to 'UnionFind::UnionFind(int&, int)'
   53 |         UnionFind ab(n, 0);
      |                          ^
a.cc:15:9: note: candidate: 'UnionFind::UnionFind(int)'
   15 |         UnionFind(int n){
      |         ^~~~~~~~~
a.cc:15:9: note:   candidate expects 1 argument, 2 provided
a.cc:11:7: note: candidate: 'UnionFind::UnionFind(const UnionFind&)'
   11 | class UnionFind{
      |       ^~~~~~~~~
a.cc:11:7: note:   candidate expects 1 argument, 2 provided
a.cc:11:7: note: candidate: 'UnionFind::UnionFind(UnionFind&&)'
a.cc:11:7: note:   candidate expects 1 argument, 2 provided
Language: C++

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

// 人を頂点とし，友達関係を辺とするグラフにおいて，連結成分のサイズから友達||ブロック関係を除く

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

int main()
{
    int N, M, K;
    cin >> N >> M >> K;
    UnionFind graph(N);
    vector<int> friendship(N, 0);
    vector<vector<int>> block(N);
    for (int i = 0; i < M; i++)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        friendship[a]++;
        friendship[b]++;
        graph.unite(a, b);
    }
    for (int i = 0; i < K; i++)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        block[a].push_back(b);
        block[b].push_back(a);
    }

    for (int i = 0; i < N; i++)
    {
        int ans = graph.size(i) - friendship[i] - 1;
        for (int u : block[i])
        {
            if (graph.same(i, u))
                ans--;
        }
        printf("%d%c", ans, i == n - 1 ? '\n' : ' ');
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:34: error: 'n' was not declared in this scope
   65 |         printf("%d%c", ans, i == n - 1 ? '\n' : ' ');
      |                                  ^
Language: C++

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

int N, M, K;
map<int, map<int, int>> friends;
map<int, map<int, int>> blocks;
map<int, int> groups;
map<int, map<int, int>> members;

void dfs(int group, int member){
  if(groups[member]>0) return;

  groups[member]=group;
  members[group][member]++;
  for (auto fri: friends[member]){
    dfs(group, fri);
  }
}

int count(int member){
  
  int group = groups[member];
  int toBeFriends =0;
  for (auto fri: members[group]) {
    if (fri.second==0) continue;
    int target = fri.first;
    
    if (friends[member][target]>0) continue; // friend.
    if (blocks[member][target]>0) continue; // block.
    if (member==target) continue; // ourself.
    
    toBeFriends++;
  }
  return toBeFriends;
}

int main(){
  
  cin >> N >> M >> K;
  
  for (int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B;
    friends[A][B]++;
    friends[B][A]++;
  }
  for (int i = 0; i < K; i++) {
    int C, D;
    cin >> C >> D;
    blocks[C][D]++;
    blocks[D][C]++;
  }
  
  int g=0;
  for (int i = 1; i <= N; i++) {
    dfs(++g,i);
  }
  
  for (int i = 1; i <= N; i++) {
    cout << count(i) << " ";
  }
  
  cout << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:16:16: error: cannot convert 'std::pair<const int, int>' to 'int'
   16 |     dfs(group, fri);
      |                ^~~
      |                |
      |                std::pair<const int, int>
a.cc:10:25: note:   initializing argument 2 of 'void dfs(int, int)'
   10 | void dfs(int group, int member){
      |                     ~~~~^~~~~~
Language: C++

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

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

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

    int size(int x)
    {
        return -d[find(x)];
    }


};

int deg[10000005];
vector<int>to[10000005];

int main()
{
     int n,m,k;
     cin>>n>>m>>k;
  
     UnionFind uf(n);
  
     rep(i,m)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
       
         deg[a]++;
         deg[b]++;
       
         uf.unite(a,b);
     
     }
  
     rep(i,k)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
         
         to[a].push_back(b);
         to[b].push_back(a);
     
     }
  
     rep(i,n)
     {
        int ans = uf.size(i)-1-deg[i];
        for(int u:to[i]){
          if(uf.same(i,u))ans--;
         }
    
      cout<<ans<<' ';
     
    }
  
  cout<<endl;
  
  return 0;
  
   

}


Compiler output:
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:8:23: error: no match for call to '(std::vector<int>) (int)'
    8 |     UnionFind(int n){d(-1);}
      |                      ~^~~~
Language: C++

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

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

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

    int size(int x)
    {
        return -d[find(x)];
    }


};

int deg[10000005];
vector<int>to[10000005];

int main()
{
     int n,m,k;
     cin>>n>>m>>k;
  
     UnionFind uf(n);
  
     rep(i,m)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
       
         deg[a]++;
         deg[b]++;
       
         uf.unite(a,b);
     
     }
  
     rep(i,k)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
         
         to[a].push_back(b);
         to[b].push_back(a);
     
     }
  
     rep(i,n)
     {
        int ans = uf.size(i)-1-deg[i];
        for(int u:to[i]){
          if(uf.same(i,u))ans--;
         }
    
      cout<<ans<<' ';
     
    }
  
  cout<<endl;
  
  return 0;
  
   

}


Compiler output:
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:8:23: error: no match for call to '(std::vector<int>) (int&, int)'
    8 |     UnionFind(int n){d(n,-1);}
      |                      ~^~~~~~
Language: C++

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

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

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

    int size(int x)
    {
        return -d[find(x)];
    }


};

int deg[100005];
vector<int>to[100005];

int main()
{
     int n,m,k;
     cin>>n>>m>>k;
  
     UnionFind uf(n);
  
     rep(i,n)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
       
         deg[a]++;
         deg[b]++;
       
         uf.unite(a,b);
     
     }
  
     rep(i,k)
     {
         int a,b;
         cin>>a>>b;
         a--;b--;
         
         to[a].push_back(b);
         to[b].push_back(a);
     
     }
  
     rep(i,n)
     {
        int ans = uf.size(i)-1-deg[i];
        for(int u:to[i]){
          if(uf.same(i,u))ans--;
        
        }
       cout<<ans;
     
     }
  
  cout<<endl;
  
  
  
  return 0;
  
   

}


Compiler output:
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:8:23: error: no match for call to '(std::vector<int>) (int&, int)'
    8 |     UnionFind(int n){d(n,-1);}
      |                      ~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
#define PI 3.14159265358979
//const int64_t INF = 1LL << 60;
const int INF = 1 << 29;
//const int MODINF = 1000000007;
//const int64_t INF = 998244353;
using namespace std;

struct UnionFind {
    vector<int> par;
    
    UnionFind(int N) : par(N){
        for (int i = 0; i < N; i++) par[i] = i;
    }
    
    int root (int x){
        if (par[x] == x) return x;
        else return par[x] = root(par[x]);
    // 再帰しつつpar[x]を大親に貼り直し
    }
    
    void unite(int x, int y){
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }
    
    bool same (int x, int y){
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main(){
    int N, M, K;
    cin >> N >> M >> K;
    
    UnionFind tree(N);
    
    vector<int> A(M), B(M), C(K), D(K);
    vector<set<int>> fri(N + 1), blo(N + 1);
    rep(i, 0, M){
        cin >> A.at(i) >> B.at(i);
        tree.unite(A.at(i), B.at(i));
        fri.at(A.at(i)).insert(B.at(i));
        fri.at(B.at(i)).insert(A.at(i));
    }
    rep(i, 0, K){
        cin >> C.at(i) >> D.at(i);
        fri.at(C.at(i)).insert(D.at(i));
        fri.at(D.at(i)).insert(C.at(i));
    }
    vector<int> ans(N, 0);
    rep(i, 1, N){
        rep(j, i + 1, N + 1){
            if(fri.at(i).count(j) || blo.at(i).count(j)) continue;
            else if(tree.same(i, j)){
                ans.at(i - 1)++;
                ans.at(j - 1)++;
            }
        }
    }
    rep(i, 0, N){
        cout << ans.at(i) << " "
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:33: error: expected ';' before '}' token
   69 |         cout << ans.at(i) << " "
      |                                 ^
      |                                 ;
   70 |     }
      |     ~
Language: C++

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

typedef unsigned long long ull;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int N,M,K,k=2;
	int A,B,C,D;
  
	cin >> N >> M >> K;
  	int count[N+5]={};
  	int place[N+5]={};
	int v[M+5]={};
  	M--;
  
  	cin >> A >> B;
	count[A]++;
	count[B]++;a
  	v[1]=2;
  	place[A]=place[B]=1;
  
  while(M--){
	cin >> A >> B;
	count[A]++;
	count[B]++;
    
    	if((place[A]==0)&&(place[B]==0)) {
        	v[k]=2;
          	place[A]=k;
          	place[B]=k;
			k++;
        }
    	else if(place[A]==place[B]);
		else if((place[A]==0)&&(place[B]!=0)) {
          v[place[B]]++;
          place[A]=place[B];
        }
		else if((place[A]!=0)&&(place[B]==0)){
          v[place[A]]++;
          place[B]=place[A];
        }
    	else{
        v[place[B]]+=v[place[A]];
         FOR(i,1,N+1){
         if((place[i]==place[A])&&(i!=A)) place[i]=place[B];
        }
        v[place[A]]=0;
        place[A]=place[B];
        }
  }

  while(K--){
	cin >> C >> D;
     if((place[C]==place[D])&&(place[C]!=0)){
     		count[C]++;
			count[D]++;
     }
    }

  	FOR(i,1,N+1){
  	if(place[i]==0) cout << "0" << " ";
  	else  cout << v[place[i]]- count[i] - 1 << " ";
    }

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 'a' was not declared in this scope
   23 |         count[B]++;a
      |                    ^
Language: C++

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

vector <int> group_idx(n, -1);
vector <bool> visited(n, false);
vector<vector<int>> friends(n);

int dfs(int cur, int par, int idx) {
    group_idx[cur] = idx;
    visited[cur] = true;

    int sz = 1;
    for (int ch : friends[cur]) {
        if (ch == par) continue;
        if (visited[ch]) continue;
        sz += dfs(ch, cur, idx);
    }

    return sz;
}

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

    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        friends[a].push_back(b);
        friends[b].push_back(a);
    }

    vector<vector<int>> blocks(n);
    for (int i = 0; i < k; i++) {
        int c, d;
        cin >> c >> d;
        c--; d--;
        blocks[c].push_back(d);
        blocks[d].push_back(c);
    }

    int idx = 0;
    vector <int> sz;
    for (int i = 0; i < n; i++) {
        if (!visited[i]) {
            int graph_size = dfs(i, -1, idx);
            sz.push_back(graph_size);
            idx++;
        }
    }

    for (int i = 0; i < n; i++) {
        int ans = sz[group_idx[i]] + friends[i].size() - 1;
        for (int nxt : blocks[i]) {
            if (group_idx[i] == group_idx[nxt]) {
                ans--;
            }
        }
        cout << ans << ' ';
    }

    cout << endl;
    return 0;
}

Compiler output:
a.cc:5:24: error: 'n' was not declared in this scope
    5 | vector <int> group_idx(n, -1);
      |                        ^
a.cc:6:23: error: 'n' was not declared in this scope
    6 | vector <bool> visited(n, false);
      |                       ^
a.cc:7:29: error: 'n' was not declared in this scope
    7 | vector<vector<int>> friends(n);
      |                             ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<long double, long double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int MOD = 1000000007;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

struct graph{
    int ren = 0;
    int kouho = 0;
    set<int> s;
    set<int>::iterator ite;;
    vector<int> egde;
    vector<int> block;
};

int main(){
    int n, m, k; cin >> n >> m >> k;
    vector<graph> vs(n);
    rep(i,m){
        int a, b; cin >> a >> b;
        vs[a-1].egde.emplace_back(b-1);
        vs[b-1].egde.emplace_back(a-1);
    }
    rep(i,k){
        int a, b; cin >> a >> b;
        vs[a-1].block.emplace_back(b-1);
        vs[b-1].block.emplace_back(a-1);
    }
    rep(i,n){
        if (vs[i].ren != 0) continue;
        stack<int> st;
        st.push(i);
        while (!st.empty()){
            int a = st.top(); st.pop();
            vs[i].s.insert(a);
            rep(j,vs[a].egde.size()){
                if (vs[i].s.find(vs[a].egde[j]) == vs[i].s.end()){
                    st.push(vs[a].egde[j]);
                }
            }
        }
        for (int x:vs[i].s){
            vs[x].ren = vs[i].s.size();
            vs[x].kouho = vs[x].ren - 1;
            rep(j,vs[x].block.size()){
                if (vs[i].s.find(vs[x].block[j]) != vs[i].s.end()){
                    vs[x].kouho--;
                }
            }
            kouho -= vs[x].egde.size();
        }
    }
    rep(i,n-1) cout << vs[i].kouho << " ";
    cout << vs[n-1].kouho << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:13: error: 'kouho' was not declared in this scope
   83 |             kouho -= vs[x].egde.size();
      |             ^~~~~