criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int k = sc.nextInt();

    public static void main(String[] args) {

        new FriendSuggestions().run();

    }

    void run() {
        int[] friendNum = new int[n];
        int[] blockNum = new int[n];

        UnionFind u = new UnionFind(n);

        for (int i=0; i<m; i++) {
            int a = sc.nextInt()-1;
            int b = sc.nextInt()-1;
            u.unite(a, b);
            friendNum[a]++;
            friendNum[b]++;
        }

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

            if (u.same(a, b)) {
                blockNum[a]++;
                blockNum[b]++;
            }
        }

        sc.close();

        StringBuilder sb = new StringBuilder();

        for (int i=0; i<n; i++) {
            int ans = u.size(i)-friendNum[i]-blockNum[i]-1;
            sb.append(ans+" ");
        }

        System.out.println(sb.toString());
    }

    class UnionFind {

        int[] parents, sizes;

        UnionFind(int n) {
            parents = new int[n];
            sizes = new int[n];
            for (int i=0; i<n; i++) {
                parents[i] = i;
                sizes[i] = 1;
            }
        }

        public int find(int x) {
            if (x==parents[x]) return x;
            return parents[x] = find(parents[x]);
        }

        public void unite(int x, int y) {
            x = find(x);
            y = find(y);
            if (x==y) return;
            if (sizes[x] < sizes[y]) {
                int tmp = x;
                x = y;
                y = tmp;
            }
            parents[y] = x;
            sizes[x] += sizes[y];
        }

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

        public int size(int x) {
            return sizes[find(x)];
        }

    }
}


Compiler output:
Main.java:12: error: cannot find symbol
        new FriendSuggestions().run();
            ^
  symbol:   class FriendSuggestions
  location: class Main
1 error
Language: Java

import java.util.*;

public class FriendSuggestions {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int k = sc.nextInt();

    public static void main(String[] args) {

        new FriendSuggestions().run();

    }

    void run() {
        int[] friendNum = new int[n];
        int[] blockNum = new int[n];

        UnionFind u = new UnionFind(n);

        for (int i=0; i<m; i++) {
            int a = sc.nextInt()-1;
            int b = sc.nextInt()-1;
            u.unite(a, b);
            friendNum[a]++;
            friendNum[b]++;
        }

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

            if (u.same(a, b)) {
                blockNum[a]++;
                blockNum[b]++;
            }
        }

        sc.close();

        StringBuilder sb = new StringBuilder();

        for (int i=0; i<n; i++) {
            int ans = u.size(i)-friendNum[i]-blockNum[i]-1;
            sb.append(ans+" ");
        }

        System.out.println(sb.toString());
    }

    class UnionFind {

        int[] parents, sizes;

        UnionFind(int n) {
            parents = new int[n];
            sizes = new int[n];
            for (int i=0; i<n; i++) {
                parents[i] = i;
                sizes[i] = 1;
            }
        }

        public int find(int x) {
            if (x==parents[x]) return x;
            return parents[x] = find(parents[x]);
        }

        public void unite(int x, int y) {
            x = find(x);
            y = find(y);
            if (x==y) return;
            if (sizes[x] < sizes[y]) {
                int tmp = x;
                x = y;
                y = tmp;
            }
            parents[y] = x;
            sizes[x] += sizes[y];
        }

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

        public int size(int x) {
            return sizes[find(x)];
        }

    }
}


Compiler output:
Main.java:3: error: class FriendSuggestions is public, should be declared in a file named FriendSuggestions.java
public class FriendSuggestions {
       ^
1 error
Language: C++

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

constexpr unsigned int max_buf = 1e5 + 1;

int count_cluster(std::vector<int> &cluster, const std::vector<std::vector<int>> &F, int i, int count)
{
	if (cluster[i] < 0)
	{
		cluster[i] = count;
		int sum = 1;
		for (int j : F[i])
		{
			sum += count_cluster(cluster, F, j, count);
		}
		return sum;
	}
	else
	{
		return 0;
	}
}

std::vector<int> calc_cluster_ninzu(const std::vector<std::vector<int>>& F, int N)
{
	std::vector<int> cluster(N, -1);
	int cluster_count = 0;
	for (int i = 0; i < N; i++)
	{
		find_cluster(cluster, F, i, cluster_count++);
	}

	std::vector<int> cluster_ninzu(N, 0);
	for (int i = 0; i < cluster_count; i++)
	{
		int count = std::count_if(begin(cluster), end(cluster), [i](int c) { return c == i; });
		for (int j = 0; j < N; j++)
		{
			if (cluster[j] == i)
			{
				cluster_ninzu[j] = count;
			}
		}
	}
	return cluster_ninzu;
}

int main()
{
	int N, M, K;
	std::cin >> N >> M >> K;

	std::vector<std::vector<int>> F(N);
	std::vector<std::vector<int>> B(N);

	for (int i = 0; i < M; i++)
	{
		int a, b;
		std::cin >> a >> b;

		F[a-1].push_back(b-1);
		F[b-1].push_back(a-1);
	}

	for (int i = 0; i < K; i++)
	{
		int a, b;
		std::cin >> a >> b;

		B[a-1].push_back(b-1);
		B[b-1].push_back(a-1);
	}

	std::vector<int> cluster(N, -1);
	std::vector<int> cluster_ninzu(N);
	int cluster_count = 0;
	for (int i = 0; i < N; i++)
	{
		cluster_ninzu[i] = count_cluster(cluster, F, i, cluster_count++);
	}

	for (int i = 0; i < N; i++)
	{
		int ninzu = cluster_ninzu[cluster[i]] - F[i].size() - 1;
		for (int b : B[i])
		{
			if (cluster[b] == cluster[i])
			{
				ninzu--;
			}
		}
		std::cout << ninzu << " ";
	}
}

Compiler output:
a.cc: In function 'std::vector<int> calc_cluster_ninzu(const std::vector<std::vector<int> >&, int)':
a.cc:31:17: error: 'find_cluster' was not declared in this scope; did you mean 'count_cluster'?
   31 |                 find_cluster(cluster, F, i, cluster_count++);
      |                 ^~~~~~~~~~~~
      |                 count_cluster
Language: C++

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

bool chain(a, b, F) {
  if (a == b) return true;
  for (int i : F.at(a)) return chain(i, b, F);
}

// 人aと人bが友達候補かを返す
bool is_candidate(a, b, F, B) {
  // a≠bである。
  if (a == b) return false;
  // 人aと人bはブロック関係・友人関係に無い。
  if (F.at(i).count(j) || B.at(i).count(j)) return false;
  if (chain(a, b, F)) retrun true;
  else return false;
}

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector<set<int>> F(N), B(N);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    F.at(a).insert(b);
    F.at(b).insert(a);
  }
  for (int i = 0; i < K; i++) {
    int c, d;
    cin >> c >> d;
    B.at(c).insert(d);
    B.at(d).insert(c);
  }
  for (int i = 0; i < N; i++) {
    int ans = 0;
    for (int j = 0; j < N; j++) {
      if (is_candidate(i, j, F, B) {
        ans++;
      }
    }
    cout << ans << endl;
  }
}

Compiler output:
a.cc:4:12: error: 'a' was not declared in this scope
    4 | bool chain(a, b, F) {
      |            ^
a.cc:4:15: error: 'b' was not declared in this scope
    4 | bool chain(a, b, F) {
      |               ^
a.cc:4:18: error: 'F' was not declared in this scope
    4 | bool chain(a, b, F) {
      |                  ^
a.cc:4:19: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | bool chain(a, b, F) {
      |                   ^
a.cc:10:19: error: 'a' was not declared in this scope
   10 | bool is_candidate(a, b, F, B) {
      |                   ^
a.cc:10:22: error: 'b' was not declared in this scope
   10 | bool is_candidate(a, b, F, B) {
      |                      ^
a.cc:10:25: error: 'F' was not declared in this scope
   10 | bool is_candidate(a, b, F, B) {
      |                         ^
a.cc:10:28: error: 'B' was not declared in this scope
   10 | bool is_candidate(a, b, F, B) {
      |                            ^
a.cc:10:29: error: expression list treated as compound expression in initializer [-fpermissive]
   10 | bool is_candidate(a, b, F, B) {
      |                             ^
a.cc: In function 'int main()':
a.cc:38:23: error: 'is_candidate' cannot be used as a function
   38 |       if (is_candidate(i, j, F, B) {
      |           ~~~~~~~~~~~~^~~~~~~~~~~~
a.cc:38:35: error: expected ')' before '{' token
   38 |       if (is_candidate(i, j, F, B) {
      |          ~                        ^~
      |                                   )
a.cc:41:5: error: expected primary-expression before '}' token
   41 |     }
      |     ^
Language: C++

#pragma warning (disable: 6031)
#pragma warning (disable: 26451)

#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <map>


//const int mod = 1000000007;
const int mod = 998244353;
int maximum(int a, int b) { return a < b ? b : a; }
int minimum(int a, int b) { return a > b ? b : a; }
using std::pair;

class UnionFind {
	int n;
	int* par;
public:
	UnionFind(int N) : n(N), par(new int[N]) {
		for (int i = 0; i < n; i++) {
			par[i] = i;
		}
	}
	void unite(int a, int b) {
		par[b] = root(a);
	}
	int root(int a) {
		if (par[a] == a)return a;
		return par[a] = root(par[a]);
	}
	bool isSame(int a, int b) {
		return root(a) == root(b);
	}
};


int main() {
	int N, M, K;
	scanf("%d %d %d", &N, &M, &K);
	auto fr = new vector<int>[N];
	auto bl = new vector<int>[N];
	UnionFind un(N);
	for (int i = 0; i < M; i++) {
		int a, b;
		scanf("%d %d", &a, &b);
		a--; b--;
		fr[a].push_back(b);
		fr[b].push_back(a);
		un.unite(a, b);
	}
	for (int i = 0; i < K; i++) {
		int a, b;
		scanf("%d %d", &a, &b);
		a--; b--;
		bl[a].push_back(b);
		bl[b].push_back(a);
	}
	auto cnt = new int[N] {};
	for (int i = 0; i < N; i++)cnt[un.root(i)]++;
	for (int i = 0; i < N; i++) {
		int res = cnt[un.root(i)] - 1;
		for (int j = 0; j < fr[i].size(); j++) {
			if (un.isSame(i, fr[i][j]))res--;
		}
		for (int j = 0; j < bl[i].size(); j++) {
			if (un.isSame(i, bl[i][j]))res--;
		}
		printf("%d ", res);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: 'vector' does not name a type
   44 |         auto fr = new vector<int>[N];
      |                       ^~~~~~
a.cc:44:30: error: expected primary-expression before 'int'
   44 |         auto fr = new vector<int>[N];
      |                              ^~~
a.cc:45:23: error: 'vector' does not name a type
   45 |         auto bl = new vector<int>[N];
      |                       ^~~~~~
a.cc:45:30: error: expected primary-expression before 'int'
   45 |         auto bl = new vector<int>[N];
      |                              ^~~
Language: C++

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

vector<int> fri[100005];//隣接リスト、フレンド
vector<int> blo[100005];//ブロック
vector<int> cnt[100005];//i番目のフレンドを格納する
int N,M,K;

void dfs(int c,int n){//n番目のフレンド数をcountに格納する、cはカレント
    int checker=0;
    for(int i=0;i<cnt[n].size();i++){
        if(cnt[n].at(i)==c){//来たことがある
            checker=1;
        }
    }
    if(checker==0){
        cnt[n].push_back(c);
        for(int i:fri[c]){
            dfs(i,n);
        }
    }
}
int main(){
    cin>>N>>M>>K;
    for(int i=0;i<M;i++){
        int a,b;
        cin>>a>>b;
        a--;b--;
        fri[a].push_back(b);
        fri[b].push_back(a);
    }
    for(int i=0;i<K;i++){
        int c,d;
        cin>>c>>d;
        c--;d--;
        blo[c].push_back(d);
        blo[d].push_back(c);
    }
    
    for(int i=0;i<N;i++){
        dfs(i,i);
        cout<<cnt[i].size()-fri[i].size()-bcnt-1<<" "<<endl;
        
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:43: error: 'bcnt' was not declared in this scope; did you mean 'cnt'?
   44 |         cout<<cnt[i].size()-fri[i].size()-bcnt-1<<" "<<endl;
      |                                           ^~~~
      |                                           cnt
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<string>
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

struct UnionFind {
public:
    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 fing(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, 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 member function 'bool UnionFind::same(int, int)':
a.cc:37:16: error: 'fing' was not declared in this scope; did you mean 'find'?
   37 |         return fing(x) == find(y);
      |                ^~~~
      |                find
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;

#define out(a) cout << a << endl
#define out1(a) cout << a
#define in(a) cin >> a
#define in2(a, b) cin >> a >> b
#define in3(a, b, c) cin >> a >> b >> c
#define rep(i, N) for (ll i = 0; i < (ll)N; i++)
#define rep1(i, N) for (ll i = 1; i <= (ll)N; i++)
#define repi(i, j, N) for (ll j = (ll)i + 1; j < (ll)N; j++)
#define all(v) v.begin(), v.end()

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;
}

constexpr int inf = 1e9;
constexpr ll linf = 1e18;
constexpr ll mod = 1e9 + 7;
constexpr int MAX = 200020;

int siz[MAX];
int par[MAX];
int ran[MAX];
void init(int n)
{
    rep(i, n)
    {
        par[i] = i;
        ran[i] = 0;
        siz[i] = 1;
    }
}

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 (ran[x] < ran[y])
    {
        par[x] = y;
        siz[x] += siz[y];
        siz[y] = siz[x];
    }
    else
    {
        par[y] = x;
        siz[x] += siz[y];
        siz[y] = siz[x];
        if (ran[x] == ran[y])
        {
            ran[x]++;
        }
    }
}

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

vvi fr;
vi bl;

void solve()
{
    int n, m, k;
    in3(n, m, k);
    fr.resize(n);
    bl.resize(n);
    init(n);
    rep(i, m)
    {
        int a, b;
        in2(a, b);
        a--, b--;
        fr[a].push_back[b];
        fr[b].push_back[a];
        unite(a, b);
    }
    rep(i, k)
    {
        int a, b;
        in2(a, b);
        a--, b--;
        if (same(a, b))
        {
            bl[a]++, bl[b]++;
        }
    }
    rep(i, n)
    {
        int ans = siz[i] - fr[i].size() - bl[i];
        cout << ans << " ";
    }
    cout << endl;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:115:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
  115 |         fr[a].push_back[b];
      |                        ^
a.cc:116:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
  116 |         fr[b].push_back[a];
      |                        ^
Language: C++

		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);

	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--;
				// 同じグループのブロックしている人は引く
				// ブロックしている友達はいない
			}
		}
		cout << ans;
		if (i == N - 1) {
			cout << endl;
		}
		else {
			cout << " ";
		}
	}

}

Compiler output:
a.cc:1:17: error: expected unqualified-id before 'return'
    1 |                 return true;
      |                 ^~~~~~
a.cc:2:9: error: expected declaration before '}' token
    2 |         }
      |         ^
a.cc: In function 'bool same(int, int)':
a.cc:5:24: error: 'find' was not declared in this scope
    5 |                 return find(x) == find(y);
      |                        ^~~~
a.cc: In function 'int size(int)':
a.cc:9:25: error: 'd' was not declared in this scope
    9 |                 return -d[find(x)];
      |                         ^
a.cc:9:27: error: 'find' was not declared in this scope
    9 |                 return -d[find(x)];
      |                           ^~~~
a.cc: At global scope:
a.cc:11:1: error: expected declaration before '}' token
   11 | };
      | ^
a.cc:14:1: error: 'vector' does not name a type
   14 | vector<int> to[100005]; // ブロックリスト
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |         cin >> N >> M >> K;
      |         ^~~
a.cc:19:9: error: 'UnionFind' was not declared in this scope
   19 |         UnionFind uf(N);
      |         ^~~~~~~~~
a.cc:28:17: error: 'uf' was not declared in this scope
   28 |                 uf.unite(a, b);
      |                 ^~
a.cc:36:17: error: 'to' was not declared in this scope
   36 |                 to[a].push_back(b);
      |                 ^~
a.cc:41:27: error: 'uf' was not declared in this scope
   41 |                 int ans = uf.size(i) - 1 - deg[i];
      |                           ^~
a.cc:42:30: error: 'to' was not declared in this scope
   42 |                 for (int u : to[i]) {
      |                              ^~
a.cc:49:17: error: 'cout' was not declared in this scope
   49 |                 cout << ans;
      |                 ^~~~
a.cc:51:33: error: 'endl' was not declared in this scope
   51 |                         cout << endl;
      |                                 ^~~~
Language: C++

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

using ll = long long;

// Disjoint Set
template<typename T>
class UnionFind {
 public:
  // n要素で生成
  explicit UnionFind(T n) : _size{n}, _parent{vector<T>(n, -1)} {}
  // 木の根を求める
  T find(T x) {
    if (x < 0 || x >= _size) return x;
    if (_parent[x] < 0) return x;
    return _parent[x] = find(_parent[x]);
  }
  // xとyの属する集合を併合する
  bool unite(T x, T y) {
    if (x < 0 || x >= _size || y < 0 || y >= _size) return false;
    x = find(x), y = find(y);
    if (x == y) return false;
    if (size(x) > size(y)) {
      _parent[x] += _parent[y];
      _parent[y] = x;
    } else {
      _parent[y] += _parent[x];
      _parent[x] = y;
    }
    return true;
  }
  // xとyが同じ集合に属するか
  bool same(T x, T y) { return find(x) == find(y); }
  // xの属する集合の個数を求める
  T size(T x) {
    if (x < 0 || x >= _size) return 1;
    return -_parent[find(x)];
  }
  // 全体の個数を求める
  T size() { return _size; }
 private:
  T _size;
  vector<T> _parent; // 親の番号（親自身はー（マイナス）集合要素の個数）
};

constexpr int MAX_N = 1e5;
char like[MAX_N][MAX_N];
int ans[MAX_N];

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  UnionFind<int> uf(N);
  for (int i{}; i < M; ++i) {
    int A, B;
    cin >> A >> B;
    --A, --B;
    like[A][B] = like[B][A] = 1;
    uf.unite(A, B);
  }
  for (int i{}; i < K; ++i) {
    int C, D;
    cin >> C >> D;
    --C, --D;
    like[C][D] = like[D][C] = -1;
  }
  map<int, vector<int>> m;
  for (int i{}; i < N; ++i) {
    int k = uf.find(i);
    m[k].push_back(i);
  }
  for (const auto &p : m) {
    const vector<int> &v = p.second;
    ll size = v.size();
    for (int i{}; i < size - 1; ++i) {
      for (int j{i+1}; j < size; ++j) {
        if (like[v[i]][v[j]] == 0) {
          ++ans[v[i]], ++ans[v[j]];
        }
      }
    }
  }

  cout << ans[0];
  for (int i{1}; i < N; ++i) {
    cout << ' ' << ans[i];
  }
  cout << endl;
  return 0;
}


Compiler output:
/tmp/ccLws2F0.o: in function `main':
a.cc:(.text+0x395): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
a.cc:(.text+0x3ac): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
a.cc:(.text+0x3d8): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
a.cc:(.text+0x3ef): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
a.cc:(.text+0x456): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
a.cc:(.text+0x49b): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccLws2F0.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<cstring>
//#include<string>
//#include<queue>
//#include<cmath>
//#include<algorithm>
//#define debug1 cout<<"?"<<endl;
//#define debug2 cout<<"?"<<i<<endl;
#define PII pair<int,int>
typedef long long ll;
const int maxn=3e5+9;
const double pi=acos(-1);
const int mod=998244353;
const int INF=0x3f3f3f3f;
const double ep=1e-7;
using namespace std;
vector<int>v1[maxn],v2[maxn];
int pre[maxn];
int Find(int x)
{
	return pre[x]==x?x:pre[x]=Find(pre[x]);
}
void unix(int x,int y)
{
	int fx=Find(x),fy=Find(y);
	if(fx!=fy)pre[fy]=fx;
}
int main()
{
	int siz[maxn]={0},i,n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	for(i=1;i<=n;i++)pre[i]=i,siz[i]=1;
	int x,y,fx,fy;
	for(i=1;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		v1[x].push_back(y);
		v1[y].push_back(x);
		fx=Find(x),fy=Find(y);
		if(fx!=fy)siz[fx]+=siz[fy],unix(fx,fy);
	}
	for(i=1;i<=k;i++)
	{
		scanf("%d%d",&x,&y);
		v2[x].push_back(y);
		v2[y].push_back(x);
	}
	for(i=1;i<=n;i++)
	{
		fx=Find(i);
		int sum=siz[fx]-v1[i].size()-1;
		for(int j:v2[i])
		{
			fy=Find(j);
			if(fx==fy)sum--;
		}
		printf("%d ",sum);
	}
	puts("");
}

Compiler output:
a.cc:25:6: error: expected unqualified-id before numeric constant
   25 | void unix(int x,int y)
      |      ^~~~
a.cc: In function 'int main()':
a.cc:42:48: error: expression cannot be used as a function
   42 |                 if(fx!=fy)siz[fx]+=siz[fy],unix(fx,fy);
      |                                                ^
Language: C++

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

vector<vector<int>> friends;
vector<vector<int>> brock;
vector<int> check;

int bfs(int root,int now){
    int ans=0; int l=0;
    while(l<friends[root].size()){
        int next=friends[root][l];
        if(!check[root]){
            check[root]=now;
            ans++;
        }
        if(!check[next]) ans+=bfs(next,now);
        l++;
    }
    return ans;
}


int main(){
    int n,m,k; cin >> n >> m >> k;
    friends.resize(n);
    brock.resize(n);
    check=vector<int>(n,0);
    rep(i,m){
        int a,b; cin >> a >> b;
        a--; b--;
        friends[a].push_back(b);
        friends[b].push_back(a);
    }
    rep(i,k){
        int c,d; cin >> c >> d;
        c--; d--;
        brock[c].push_back(d);
        brock[d].push_back(c);
    }
    
    vector<int> ans(n+1,0);

    int nownow=1;

    rep(i,n){
        if(!check[i]){
            ans[nownow]=bfs(i,nownow);
            nownow++;
        }
    }

    vector<int> br(n,0);

    rep(i,n){
        rep(j,brock[i].size()){
            if(check[brock[i][j]]==check[i]) br[i]++;
        }
    }

    rep(i,n){
        int co=max(0,ans[check[i]]-friends[i].size()-br[i]-1;
        printf("%d ",co);
    }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:61: error: expected ')' before ';' token
   65 |         int co=max(0,ans[check[i]]-friends[i].size()-br[i]-1;
      |                   ~                                         ^
      |                                                             )
Language: C++

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

class UnionFind
{
public:
    static UnionFind Create(int iTotalNumber)
    {
        return UnionFind(iTotalNumber);
    }

    void Init(const int iTotalNum)
    {
        mParent.resize(iTotalNum);
        mRank.resize(iTotalNum);
        mSize.resize(iTotalNum);
        for (int i = 0; i < iTotalNum; i++)
        {
            mParent[i] = i;
            mRank[i] = 0;
            mSize[i] = 1;
        }
    }

    int FindParent(const int iRoot)
    {
        if (iRoot == mParent[iRoot])
        {
            return iRoot;
        }
        else
        {
            mParent[iRoot] = FindParent(mParent[iRoot]);
            return mParent[iRoot];
        }
    }

    void UniteGroup(const int iRoot1, const int iRoot2)
    {
        int parent1 = this->FindParent(iRoot1);
        int parent2 = this->FindParent(iRoot2);
        if (parent1 == parent2) return;

        if (mRank[parent1] < mRank[parent2])
        {
            mParent[parent1] = parent2;
            mSize[parent2] = mSize[parent1] + mSize[parent2];
        }
        else if (mRank[parent2] < mRank[parent1])
        {
            mParent[parent2] = parent1;
            mSize[parent1] = mSize[parent1] + mSize[parent2];
        }
        else if (mRank[parent2] == mRank[parent1])
        {
            mParent[parent2] = parent1;
            mSize[parent1] = mSize[parent1] + mSize[parent2];
            mRank[parent2]++;
        }
        //else should never happen
    }

    bool AreInTheSameGroup(const int iRoot1, const int iRoot2)
    {
        return FindParent(iRoot1) == FindParent(iRoot2);
    }

    int GetGroupSize(int iRoot)
    {
        int parent = FindParent(iRoot);
        return mSize[parent];
    }

private:
    UnionFind::UnionFind(int iTotalNumber)
    {
        this->Init(iTotalNumber);
    }


    std::vector<int> mParent;
    std::vector<int> mRank;
    std::vector<int> mSize;
};

int main(void) 
{
    int N, M, K;
    cin >> N >> M >> K;
    UnionFind unionFind = UnionFind::Create(N);
    vector<vector<int>> fr(N, vector<int>());
    vector<vector<int>> bl(N, vector<int>());

    for (int i = 0; i < M; i++)
    {
        int x, y;
        cin >> x >> y;
        fr[x-1].emplace_back(y-1);
        fr[y-1].emplace_back(x-1);
        unionFind.UniteGroup(x-1, y-1);
    }
    
    for (int i = 0; i < K; i++)
    {
        int x, y;
        cin >> x >> y;
        if (false == unionFind.AreInTheSameGroup(x-1, y-1)) continue;
        bl[x-1].emplace_back(y-1);
        bl[y-1].emplace_back(x-1);
    }

    for (int i = 0; i < N; i++)
    {
        int friendCandidate = unionFind.GetGroupSize(i) - fr[i].size() - bl[i].size() - 1;
        cout << friendCandidate << " ";
    }

    cout << endl;

    return 0;
}

Compiler output:
a.cc:77:5: error: extra qualification 'UnionFind::' on member 'UnionFind' [-fpermissive]
   77 |     UnionFind::UnionFind(int iTotalNumber)
      |     ^~~~~~~~~
Language: Java

public class Main {

    static class UnionFind {
        int[] d;
        UnionFind(int n) {
            d = new int[n];
            Arrays.fill(d, -1);
        }

        int find(int x) {
            if(d[x] < 0) return x;
            return d[x] = find(d[x]);
        }

        boolean unite(int x, int y) {
            x = find(x); y = find(y);
            if(x == y) return false;
            if(d[x] > d[y]) {
                int tmp = x; x = y; y = x;
            }
            d[x] += d[y];
            d[y] = x;
            return true;
        }

        boolean same(int x, int y) { return find(x) == find(y); }
        int size(int x) { return -d[find(x)]; }
    }

    public static void main(String[] args) {
    	
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt();
        UnionFind uf = new UnionFind(n);
        int[] deg = new int[n];
        for(int i = 0; i < m; i++) {
            int a, b;
            a = Integer.parseInt(sc.next()); b = Integer.parseInt(sc.next());
            --a; --b;
            deg[a]++; deg[b]++;
            uf.unite(a, b);
        }
        int[][] to = new int[k][2];
        for(int i = 0; i < k; i++) {
        	to[i][0] = Integer.parseInt(sc.next()) -1;
        	to[i][1] = Integer.parseInt(sc.next()) -1;
        }
        int[] ans = new int[n];
        for(int i = 0; i < n ; i++) {
            ans[i] = uf.size(i) - 1 - deg[i];
        }
        for(int i = 0; i < k; i++) {
        	if(uf.same(to[i][0], to[i][1])) {
        		ans[to[i][0]]--;
        		ans[to[i][1]]--;
        	}
        }
        for(int i = 0; i < n; i++) {
        	System.out.printf("%d%c", ans[i], i==n-1?'\n':' ');
        }
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
            Arrays.fill(d, -1);
            ^
  symbol:   variable Arrays
  location: class UnionFind
Main.java:32: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:32: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

#include <iostream>
using namespace std;


int f[100000][100000], b[100000][100000], n, m, k;

bool isf(int s, int c, int g, int num, int *a){
  //cout << "s:" << s << "c:" << c << " g:" << g << " num:" << num << endl;
  if(c == g) return true;
  if(s == c && num > 0) return false;
  if(num >= n) return false;
  a[num] = c;
/*  for(int i = 0; i < num + 1; i++) cout << a[i] << " ";
  cout << endl;*/
  for(int i = 0; i < num; i++){
    if(a[i] == c) return false;
  }
  for(int i = 0; i < n; i++){
    if(c == i) continue;
    //cout << f[c][i] << endl;
    if(f[c][i] == 1 && isf(s, i, g, num + 1, a) == true) return true;
  }
  return false;
}

int main(){
  cin >> n >> m >> k;
  for(int i = 0; i < n; i++) for(int j = 0; j < n; j++){
    f[i][j] = -1;
    b[i][j] = -1;
  }
  int x, y;
  for(int i = 0; i < m; i++){
    cin >> x >> y;
    f[x - 1][y - 1] = 1;
    f[y - 1][x - 1] = 1;
  }
  for(int i = 0; i < k; i++){
    cin >> x >> y;
    b[x - 1][y - 1] = 1;
    b[y - 1][x - 1] = 1;
  }
/*
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      cout << f[i][j] << " ";
    }
    cout << endl;
  }
  cout << endl;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      cout << b[i][j] << " ";
    }
    cout << endl;
  }
  cout << endl;
*/
  int fq[n];
  for(int i = 0; i < n; i++) fq[i] = 0;
  for(int i = 0; i < n - 1; i++){
    for(int j = i + 1; j < n; j++){
      if(f[i][j] == -1 && b[i][j] == -1){
        int a[n];
        if(isf(i, i, j, 0, a) == true){
          fq[i]++;
          fq[j]++;
        }
      }
    }
  }
  for(int i = 0; i < n; i++){
    cout << fq[i];
    if(i != n - 1) cout << " ";
  }
  cout << endl;
}


Compiler output:
/tmp/ccTlzVEN.o: in function `isf(int, int, int, int, int*)':
a.cc:(.text+0x44): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x12a): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTlzVEN.o
/tmp/ccTlzVEN.o: in function `main':
a.cc:(.text+0x14e): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x16a): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x17f): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x1eb): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x1fc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x2b0): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x317): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccTlzVEN.o
a.cc:(.text+0x348): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1e5+5;
struct node{
	int x,y;
}p1[maxn];
vector<int>vec[maxn],vec1[maxn];
int cnt[maxn];
int pre[maxn];
int find(int x){
	if(x==pre[x])return x;
	else pre[x]=find(pre[x]);
}
void Merge(int x,int y){
	int xx=find(x);
	int yy=find(y);
	if(xx!=yy){
		pre[xx]=yy;
		return ;
	}
	return ;
}
int main(){
    int n,m,k;
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++){
        pre[i]=i;
    }
    for(int i=1;i<=m;i++){
    	scanf("%d%d",&p1[i].x,&p1[i].y);
    	vec[p1[i].x].push_back(p1[i].y);
    	vec[p1[i].y].push_back(p1[i].x);
    	Merge(p1[i].x,p1[i].y);
    }
    int xx,yy;
    for(int i=1;i<=k;i++){
    	scanf("%d%d",&xx,&yy);
    	if(find(xx)==find(yy)){
    	vec1[xx].push_back(yy);
    	vec1[yy].push_back(xx);
    	    
    	}
    	
    }
    for(int i=1;i<=n;i++){
    	cnt[find(i)]++;
    }
   
    for(int i=1;i<=n;i++){
    	cout<< cnt[find(i)]-vec[i].size()-vec1[i].size()-1<<" ";
    }

	return 0;
}

Compiler output:
a.cc:10:1: error: 'vector' does not name a type
   10 | vector<int>vec[maxn],vec1[maxn];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:34:9: error: 'vec' was not declared in this scope
   34 |         vec[p1[i].x].push_back(p1[i].y);
      |         ^~~
a.cc:42:9: error: 'vec1' was not declared in this scope
   42 |         vec1[xx].push_back(yy);
      |         ^~~~
a.cc:53:29: error: 'vec' was not declared in this scope
   53 |         cout<< cnt[find(i)]-vec[i].size()-vec1[i].size()-1<<" ";
      |                             ^~~
a.cc:53:43: error: 'vec1' was not declared in this scope
   53 |         cout<< cnt[find(i)]-vec[i].size()-vec1[i].size()-1<<" ";
      |                                           ^~~~
a.cc: In function 'int find(int)':
a.cc:15:20: warning: control reaches end of non-void function [-Wreturn-type]
   15 |         else pre[x]=find(pre[x]);
      |              ~~~~~~^~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class Sub {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A, B;

		final int N = scanner.nextInt();
		prepare(N);
		int[] except = new int[N];

		final int M = scanner.nextInt();
		final int K = scanner.nextInt();

		for (int i = 0; i < M; i++) {
			A = scanner.nextInt() - 1;
			B = scanner.nextInt() - 1;
			union(A, B);
			except[A]++;
			except[B]++;
		}

		for (int i = 0; i < K; i++) {
			A = scanner.nextInt() - 1;
			B = scanner.nextInt() - 1;
			if (find(A) == find(B)) {
				except[A]++;
				except[B]++;
			}
		}

		scanner.close();

		for (int i = 0; i < N; i++) {
			System.out.print(desc[find(i)] - except[i]);
			System.out.print(i == N - 1 ? "\n" : " ");
		}
	}

	static int[] parent;
	static int[] desc;

	static void prepare(int n) {
		parent = new int[n];
		for (int i = 0; i < n; i++) {
			parent[i] = i;
		}
		desc = new int[n];
	}

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

	static void union(int x, int y) {
		int xRoot = find(x);
		int yRoot = find(y);
		if (xRoot == yRoot)
			return;
		if (desc[xRoot] >= desc[yRoot]) {
			parent[yRoot] = xRoot;
			desc[xRoot] += desc[yRoot] + 1;
		} else {
			parent[xRoot] = yRoot;
			desc[yRoot] += desc[xRoot] + 1;
		}
	}
}


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

import java.util.Scanner;

public class Sub {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A, B;

		final int N = scanner.nextInt();

		int[] except = new int[N];

		final int M = scanner.nextInt();

		for (int i = 0; i < M; i++) {
			A = scanner.nextInt() - 1;
			B = scanner.nextInt() - 1;
			union(A, B);
			except[A]++;
			except[B]++;
		}

		final int K = scanner.nextInt();
		for (int i = 0; i < M; i++) {
			A = scanner.nextInt() - 1;
			B = scanner.nextInt() - 1;
			if (find(A) == find(B)) {
				except[A]++;
				except[B]++;
			}
		}

		scanner.close();
		for (int i = 0; i < N; i++) {
			System.out.print(desc[find(i)] - except[i]);
			System.out.print(i == N - 1 ? "\n" : " ");
		}
	}

	static int[] parent;
	static int[] desc;

	static void prepare(int n) {
		parent = new int[n];
		for (int i = 0; i < n; i++) {
			parent[i] = n;
		}
		desc = new int[n];
	}

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

	static void union(int x, int y) {
		int xRoot = find(x);
		int yRoot = find(y);
		if (desc[xRoot] >= desc[yRoot]) {
			parent[yRoot] = xRoot;
			desc[xRoot] += desc[yRoot] + 1;
		} else {
			parent[xRoot] = yRoot;
			desc[yRoot] += desc[xRoot] + 1;
		}
	}
}


Compiler output:
Main.java:3: error: class Sub is public, should be declared in a file named Sub.java
public class Sub {
       ^
1 error
Language: C

//#include<bits/stdc++.h>
#include<iostream>
using namespace std;
const int N=1e5+5;
int pa[N],cnt[N],fr[N];
int search(int x){
    return pa[x]==x?x:search(pa[x]);
}
int main()
{   
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
   // while(cin>>n>>m>>k)
    
        for(int i=1;i<=n;i++){
            pa[i]=i; cnt[i]=1; fr[i]=0;
        }
        int x,y;
        while(m--)
        {
            cin>>x>>y;
            int a=search(x),b=search(y);
            fr[x]++;    fr[y]++;
            if(a!=b){
                pa[a]=b;
                cnt[b]+=cnt[a];
            }
        }
        for(int i=1;i<=n;i++){
            cnt[i]=cnt[search(i)];
        }
        while(k--)
        {
            cin>>x>>y;
            if(search(x)==search(y)){
                cnt[x]--,cnt[y]--;
            }
        }
        for(int i=1;i<=n;i++)
            cout<<cnt[i]-fr[i]-1<<' ';
        cout<<endl;
    


    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf=0x3f3f3f3f;
const int MOD=1e9+7;
int par[100005],ranks[100005],ans[100005];
void init(int n)
{
	for(int i=0;i<n;i++)
	{
		par[i]=i;
		ranks[i]=1;
	}
}
int find(int x)
{
	if(par[x]==x)
	return x;
	else
	return par[x]=find(par[x]);
}
void Union(int x,int y)
{
	x=find(x);y=find(y);
	if(x==y) return ;
	if(ranks[x]<ranks[y])
	swap(x,y);
	par[y]=x;
	ranks[x]+=ranks[y];
}
int size(int x)
{
	return ranks[find(x)];
}
int main()
{
	int n,m,k;cin>>n>>m>>k;
	vector<int> friends[n];
	vector<int> block[n];
	int x,y;
	memset(ans,0,sizeof(ans));
	init(n);
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		x--;y--;
		Union(x,y);
		friends[x].push_back(y);
		friends[y].push_back(x);
	}
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		x--,y--;
		block[x].push_back(y);
		block[y].push_back(x);
	}
	for(int i=0;i<n;i++)
	{
		ans[i]=size(i)-1;
		for(auto x:block[i])
		{
			if(find(i)==find(x))
			ans[i]--;
		}
		for(auto x:friends[i])
		{
			if(find(i)==find(x)
			ans[i]--;
		}
		cout<<ans[i]<<' ';
	}
	cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:44: error: expected ';' before 'ans'
   68 |                         if(find(i)==find(x)
      |                                            ^
      |                                            ;
   69 |                         ans[i]--;
      |                         ~~~                 
a.cc:70:17: error: expected primary-expression before '}' token
   70 |                 }
      |                 ^
a.cc:69:34: error: expected ')' before '}' token
   69 |                         ans[i]--;
      |                                  ^
      |                                  )
   70 |                 }
      |                 ~                 
a.cc:68:27: note: to match this '('
   68 |                         if(find(i)==find(x)
      |                           ^
a.cc:70:17: error: expected primary-expression before '}' token
   70 |                 }
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf=0x3f3f3f3f;
const int MOD=1e9+7;
int par[100005],ranks[100005],ans[100005];
void init(int n)
{
	for(int i=0;i<n;i++)
	{
		par[i]=i;
		ranks[i]=1;
	}
}
int find(int x)
{
	if(par[x]==x)
	return x;
	else
	return par[x]=find(par[x]);
}
void Union(int x,int y)
{
	x=find(x);y=find(y);
	if(x==y) return ;
	if(ranks[x]<ranks[y])
	swap(x,y);
	par[y]=x;
	ranks[x]+=ranks[y];
}
int size(int x)
{
	return ranks[find(x)];
}
int main()
{
	int n,m,k;cin>>n>>m>>k;
	vector<int> friends[n];
	vector<int> block[n];
	int x,y;
	memset(ans,0,sizeof(ans));
	init(n);
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		x--;y--;
		Union(x,y);
		friends[x].push_back(y);
		friends[y].push_back(x);
	}
	for(int i=0;i<n;i++)
	{
		cin>>x>>y;
		x--,y--;
		block[x].push_back(y);
		block[y].push_back(x);
	}
	for(int i=0;i<n;i++)
	{
		ans[i]=size(i)-1;
		for(auto x:block[i])
		{
			if(find[i]==find[x])
			ans[i]--;
		}
		for(auto x:friends[i])
		{
			if(find[i]==find[x])
			ans[i]--;
		}
		cout<<ans[i]<<' ';
	}
	cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   63 |                         if(find[i]==find[x])
      |                                ^
a.cc:63:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   63 |                         if(find[i]==find[x])
      |                                         ^
a.cc:68:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   68 |                         if(find[i]==find[x])
      |                                ^
a.cc:68:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   68 |                         if(find[i]==find[x])
      |                                         ^
Language: C++

#include<iostream>
#include<vector>
#include<stack>
using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i=0;i<(n); i++)

#define WHITE 0  // 未訪問
#define BLACK 1  // 訪問ずみ

// 連結成分の番号を振る関数
void dfs(int n, int comp[], vector<int> G[]) {
  int i, j, vertex, neighbor, color[n];
  stack<int> S;
  // 初期状態
  for (i = 0; i < n; i++) color[i] = WHITE;

  for (i = 0; i < n; i++) {
    if (color[i] == WHITE) {
      // dfs
      S.push(i);
      while (!S.empty()) {
        vertex = S.top();
        S.pop();        
        color[vertex] = BLACK;  // 訪問済みにする
        comp[vertex] = i;  // 連結成分の番号を振る          
        for (j = 0; j < (int) G[vertex].size(); j++) {
          neighbor = G[vertex][j]; // 隣接している頂点：友人
	  //cout << neighbor << " " << i << " " << j<<endl;
          if (color[neighbor] == WHITE) S.push(neighbor);
        }
      }
    }
  }
}

int main() {
  int  N, m, k,q, s, t,f;

  cin >> N >> m >>k;
  int comp[N];  // 連結成分の番号
  vector<int> G[N];  // グラフを表現する隣接リスト
  vector<int> B[N];  // グラフを表現する隣接リスト

  // 隣接リストを作成
  rep(i,m) {
    cin >> s >> t;
    s--;t--;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  rep(i,k){
    cin >> s >> t;
    s--;t--;
    B[s].push_back(t);
    B[t].push_back(s);
  }

  // グラフを連結成分に分ける
  dfs(N, comp, G);

  //cout << comp[0]<<comp[1]<<comp[2]<<comp[3]<<endl;

  
  int ans,tmp;
  rep(i, N){
    tmp = comp[i];
    //cout << tmp<<B[i].size()<<endl;;
    ans =  -G[i].size() - 1;
    rep(j, n){
      if (i==j) continue;
      if (tmp=comp[j]) ans++;
    }
   
    rep(k,G[i].size()){
      if(G[i].at(k)==j) f=1;
    }
    
    rep(k,B[i].size()){
      if(B[i].at(k)==j) f=1;
    }

    if (f==1) {
      cout << 0 <<" ";
      break;
    }

    cout << ans << " ";
	
  }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:12: error: 'n' was not declared in this scope
   72 |     rep(j, n){
      |            ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for (ll i=0;i<(n); i++)
      |                                  ^
a.cc:78:22: error: 'j' was not declared in this scope
   78 |       if(G[i].at(k)==j) f=1;
      |                      ^
a.cc:82:22: error: 'j' was not declared in this scope
   82 |       if(B[i].at(k)==j) f=1;
      |                      ^
a.cc: At global scope:
a.cc:94:3: error: expected unqualified-id before 'return'
   94 |   return 0;
      |   ^~~~~~
a.cc:95:1: error: expected declaration before '}' token
   95 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll n, m; cin >> n >> m;
    vector<pair<ll, char>> v(m);
    rep(i, m) {
        ll s; char c; cin >> s >> c; s--
        v[i] = {s, c};
    }

    for (ll i = (n != 1 ? (ll)pow(10, n - 1) : 0); i < (ll)pow(10, n); i++) {
        string j = to_string(i);
        bool isok = true;
        rep(k, m) {
            if (j[v[k].first] != v[k].second) {
                isok = false;
            }
        }

        if (isok) {
            cout << j << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:41: error: expected ';' before 'v'
   17 |         ll s; char c; cin >> s >> c; s--
      |                                         ^
      |                                         ;
   18 |         v[i] = {s, c};
      |         ~