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

import java.util.*;

public class Main2 {

	static class Unionfind{
		//基本的にマイナスのサイズを持つ
		//根でなければ非負のおやのIDを持つ
		private int d[];
		
		public Unionfind(int n) {
			d = new int[n + 1];
			//初めは全員根でサイズは１なので-1で初期化
			for (int i = 0; i <= n; ++i)
				d[i] = -1;
		}
		
		public int root(int x) {
			if (d[x] < 0)
			return x;
			return d[x] = root(d[x]);
		}
		
		public boolean unite(int x, int y) {
			int rx = root(x);
			int ry = root(y);
			if(rx == ry)return false;
			//もしxのグループのほうがサイズが小さければxの親をyとしなければいけないので入れ替える。
			if(d[x] > d[y]){
				int tmp = x;
				x = y;
				y = tmp;
			}
			//yの親をxにするのでIDxのグループのサイズがd[y]だけ増える
			d[x] += d[y];
			d[y] = x;
			return true;
		}
		
		public boolean isSame(int x, int y) {
			int rx = root(x);
			int ry = root(y);
			return rx == ry;
		}
		
		public int size(int x){
			int rx = root(x);
			return -d[rx];
		}
	}
	
	static Unionfind uniontree;
	
	public static class Graph {
		List<Integer> friend = new ArrayList<Integer>();
		List<Integer> block = new ArrayList<Integer>();
		int number;

		public Graph(int num){
			number = num;
		}

		public void addfriend(int b) {
			friend.add(b);
		}

		public void addblock(int b) {
			if(uniontree.isSame(number, b))
			block.add(b);
		}
	}

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), m = sc.nextInt(), k = sc.nextInt();
		Graph graph[] = new Graph[n + 1];
		uniontree = new Unionfind(n);
		for (int i = 0; i <= n; ++i)
			graph[i] = new Graph(i);
		for (int i = 0; i < m; ++i) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			graph[a].addfriend(b);
			graph[b].addfriend(a);
			uniontree.unite(a, b);
		}
		for (int i = 0; i < k; ++i) {
			int c = sc.nextInt();
			int d = sc.nextInt();
			graph[c].addblock(d);
			graph[d].addblock(c);
		}
		sc.close();
		for (int i = 1; i <= n; ++i) {
			int num = uniontree.size(i) - (graph[i].friend.size() + graph[i].block.size()) - 1;
			// int num = uniontree.size(i);
			System.out.print(num + " ");
		}
	}
}


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

}

/*
int dp[10001][10001];

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

    memset(dp, 0, sizeof(dp));  // 0 は 人i から 人j への繋がりが無いとする

    // 答えの配列を用意
    int ans[n];
    rep(i, n) {
        ans[i] = n-1;  // 最大で n-1 人の友達候補がいる。これを引いていくのが多分一番楽
    }
    // 右隣が友達候補だったかを記憶する。0で初期化。
    int next_kouho[n-1];
    memset(next_kouho, 0, sizeof(next_kouho));

    int a[m], b[m];
    rep(i, m) {
        cin >> a[i] >> b[i];

        ans[a[i]-1]--;
        ans[b[i]-1]--;

        if (abs(a[i]-b[i]) == 1) {
            next_kouho[min(a[i], b[i]) - 1] = 1;
        }

        dp[min(a[i], b[i]) - 1][max(a[i], b[i]) - 1] = 1;
    }

    int c[k], d[k];
    rep(i, k) {
        cin >> c[i] >> d[i];

        // 友達関係であり、ブロック関係は条件としてありえないからちぇっくしなくていい。
        ans[c[i]-1]--;
        ans[d[i]-1]--;

        dp[min(c[i], d[i]) - 1][max(c[i], d[i]) - 1] = 1;
    }

    // DEBUG:
    cout << "next kouho: ";
    rep(i, n-1) {
        cout << next_kouho[i] << " ";
    }
    cout << endl;

    cout << "-------- dp  -----------" << endl;
    rep(i, n) {
        rep(j, n) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }
    cout << "----------- dp --- end" << endl;

    // ~~ここで見ないと行けないのは、友達関係でもブロック関係でもなかった人たちの間にいる人が全部友達関係かどうか~~
    // ここ勘違いしていて、友達関係をたどれば、その友達候補の隣までいけるかどうからしい。問題文からは読み取れない。
    int next_ga_tsuduku;
    rep(i, n) {
        // すでに友達候補がいなければチェックしなくていい。
        if (ans[i] == 0) {
            continue;
        }

        // 人ごとにループ。1つずつ見ていく。
        next_ga_tsuduku = 1;
        for (int j=i+1; j<n; j++) {
            if (dp[i][j] == 0 && next_ga_tsuduku == 0) {
                // ここはまだブロックにも友達関係にもないけど、その間にいる人達が友達関係にない。
                ans[i]--;
                ans[j]--;
                continue;
            }

            if (abs(j-i) != 1 && next_kouho[j-1] != 1) {
                cout << "人" << i << "の友達候補が、" << j << "で途切れた" << endl;
                next_ga_tsuduku = 0;
            }
        }
    }

    // 結果の出力
    rep(i, n) {
        if (i != 0) {
            cout << " ";
        }
        cout << ans[i];
    }
    cout << endl;
}
 */


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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n,m,k;
ll parent[100001];
ll val[100001];
ll findp(ll x)
{
    if(parent[x]!=x)
    {
        ll temp=findp(parent[x]);
        parent[x]=temp;
    }
    return parent[x];
}
int main()
{
    cin>>n>>m>>k;
    for(ll i=0;i<n;i++)
    {
        parent[i]=i;
        val[i]=1;
    }
    for(ll i=0;i<m;i++)
    {
        ll a,b;
        cin>>a>>b;
        a--;
        b--;
        ll p1=findp[a];
        ll p2=findp[b];
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |         ll p1=findp[a];
      |                      ^
a.cc:30:22: error: invalid conversion from 'long long int (*)(long long int)' to 'long long int' [-fpermissive]
   30 |         ll p1=findp[a];
      |                      ^
      |                      |
      |                      long long int (*)(long long int)
a.cc:31:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |         ll p2=findp[b];
      |                      ^
a.cc:31:22: error: invalid conversion from 'long long int (*)(long long int)' to 'long long int' [-fpermissive]
   31 |         ll p2=findp[b];
      |                      ^
      |                      |
      |                      long long int (*)(long long int)
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a)  (a).begin(),(a).end()


class UnionFind {
public:
    vector<int> par;
    vector<int> siz;

    UnionFind(int n) : par(n) , siz(n, 1){
        for(int i = 0; i < n; i++) par[i] = i;
    }

    int root(int x) {
        if (par[x] == x) return x;      // root
        return par[x] = root(par[x]);   // 経路圧縮
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //同じ木にない時：rxをryにつける
        siz[ry] += siz[rx];
    }

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

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

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

    UnionFind frt(n);
    vector<int> counter(n, 0);

    // friend
    for(int i=0; i<m; i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        frt.unite(a, b);
        counter[a]--;
        counter[b]--;
    }

    // block
    for(int i=0; i<k; i++){
        int c, d;
        cin >> c >> d;
        c--;
        d--;
        counter[c]--;
        counter[d]--;
    }

    // output
    for(int i=0; i<n; i++){
        cout << tree.size(i) + counter[i] << " ";
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:17: error: 'tree' was not declared in this scope; did you mean 'free'?
   67 |         cout << tree.size(i) + counter[i] << " ";
      |                 ^~~~
      |                 free
Language: C++

#include <iostream>
#include <vector>

#define rep(i,x) for(int i=0;i<x;i++)
using ll = long long;
using namespace std;

void dfs(const vector<vector<int>> &graph, vector<bool> &seen, vector<vector<int>> &blockList, int &cnt, int i, int v){
    seen[v] = true;
    for (auto next_v : graph[v]){
        if (seen[next_v]) continue;
        if (find(blockList[i].begin(), blockList[i].end(), next_v) == blockList[i].end()) cnt++;
        dfs(graph, seen, blockList, cnt, i, next_v);
    }
}

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<int>> graph(n);
    rep(i, m){
        int a, b; cin >> a >> b; a--; b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    vector<vector<int>> blockList(n);
    rep(i, k){
        int c, d; cin >> c >> d; c--; d--;
        blockList[c].push_back(d);
        blockList[d].push_back(c);
    }
    rep(i, n){
        vector<bool> seen(n, false);
        int cnt = 0;
        dfs(graph, seen, blockList, cnt, i, i);
        int ans = cnt - graph[i].size();
        cout << ans << " ";
    }
}


Compiler output:
a.cc: In function 'void dfs(const std::vector<std::vector<int> >&, std::vector<bool>&, std::vector<std::vector<int> >&, int&, int, int)':
a.cc:12:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   12 |         if (find(blockList[i].begin(), blockList[i].end(), next_v) == blockList[i].end()) cnt++;
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:12:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   12 |         if (find(blockList[i].begin(), blockList[i].end(), next_v) == blockList[i].end()) cnt++;
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>

constexpr unsigned int InputSize = 3e6;
unsigned char Input[InputSize];
unsigned char* pointer = Input;

inline unsigned int getInt(void){
    unsigned int res = 0; while(*pointer < '0') ++pointer;
    do{
        res = 10 * res + ((*pointer) - '0');
    } while(*(++pointer) >= '0');
    return res;
}

constexpr unsigned int N = 1e5 + 1;
unsigned int Par[N];
unsigned int Size[N];
unsigned int addr[N];

inline unsigned int root(const unsigned int v){
    return (Par[v] == v) ? v : (Par[v] = root(Par[v]));
}

inline bool same(const unsigned int u, const unsigned int v){
    return root(u) == root(v);
}

inline void unite(const unsigned int u, const unsigned int v){
    unsigned int pu = root(u), pv = root(v); if(pu == pv) return;
    if(Size[pu] > Size[pv]) std::swap(pu, pv);
    Size[pv] += Size[pu]; Par[pu] = pv;
}

inline unsigned int sizeOf(const unsigned int v){return Size[root(v)];}

int main(void){
    for(unsigned int i = 0; i < N; ++i) Par[i] = i, Size[i] = 1;

    fread(Input, sizeof(unsigned char), InputSize, stdin);
    unsigned int n = getInt(), M = getInt(), K = getInt();
    while(M--){
        unsigned int u = getInt() - 1, v = getInt() - 1;
        unite(u, v); ++addr[u], ++addr[v];
    }
    while(K--){
        unsigned int u = getInt() - 1, v = getInt() - 1;
        if(same(u, v)) ++addr[u], ++addr[v];
    }
    printf("%u", sizeOf(0) - addr[0] - 1);
    for(unsigned int i = 1; i < n; ++i) printf(" %u", sizeOf(i) - addr[i] - 1);
    putchar('\n');
    return 0;
}

Compiler output:
a.cc: In function 'void unite(unsigned int, unsigned int)':
a.cc:30:34: error: 'swap' is not a member of 'std'
   30 |     if(Size[pu] > Size[pv]) std::swap(pu, pv);
      |                                  ^~~~
Language: C++

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

//nのk乗
int pow(int n, int k) {
    if(k == 0) return 1;
    if(k % 2 == 0) {
        int tmp = pow(n, k/2);
        return tmp * tmp;
    }
    else {
        return n * pow(n, k - 1);
    }
}
//------
//グラフ
//------
//ワーシャル-フロイド法
void warshall_floyd(int V, vector<vector<int>>& matrix){
    for(int k = 0; k < V; ++k){
        for(int i = 0; i < V; ++i){
            for(int j = 0; j < V; ++j){
                matrix[i][j] = min(matrix[i][j], matrix[i][k] + matrix[k][j]);
            }
        }
    }
}

//Union-Find木
struct UF{
    const int node_num;
    vector<int> parent;
    vector<int> size;

    UF(int N) : node_num(N), parent(N), size(N, 1) {
        for(int i = 0; i < N; ++i) parent[i] = i;
    }

    //xの根を得る
    int root(int x){
        if(parent[x] == x) return x;
        return parent[x] = root(parent[x]);
    }

    //xが属する木とyが属する木を一つに合わせる
    void unite(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        if(root_x == root_y) return;
        parent[root_y] = root_x;
        size[root_x] += size[root_y];
    }

    //xとyが属する木が同じならtrueを返す
    bool same(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        return root_x == root_y;
    }

    //xと同じ木に属する要素の数を返す
    int same_size(int x){
        int root_x = root(x);
        return size[root_x];
    }
};

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>
using namespace std;
typedef long long ll;

struct edge{
    int to;
    int from;
};
struct UnionFind{//雛形を与える(初期化と結合のみ)
    vector<int> par;//親(根)
    vector<int> rank;//木の深さ

    void init(int n){//初期化関数
        par.resize(n);
        rank.resize(n);
        for(int i = 0; i < n; i++){
            par[i] = i;//初めはノード一個の木なので根は自身
            rank[i] = 1;
        }
    }

    int root(int x){//木の根を求める
    if(par[x] == x) return x;
    else return par[x] = root(par[x]);
    }

    bool same(int x, int y){//同じ木かどうか判定
        return root(x) == root(y);//同じ木ならtrue
    }

    void unite(int x, int y){
        x = root(x);
        y = root(y);
        if(x == y) return;//もし同じ木に属していたら何もしない
        if(rank[x] < rank[y]) swap(x, y);//数が大きい方に小さい方を結合させる
        par[y] = x;
        rank[x] += rank[y];//深さが同じ時だけ結合後深さが増える
    }

    int size(int x) {//深さを返す関数
        return rank[root(x)];
    }
};

int main(){
    ll N, M, K;
    cin >> N >> M >> K;
    vector<ll> r[N];
    vector<edge> G1(M);
    vector<ll> fre(N, 0);
    UnionFind U;
    U.init(N);
    for(int i = 0; i < M; i++){
        ll x, y;
        cin >> x >> y;
        x--;
        y--;
        fre[x]++;
        fre[y]++;
        U.unite(x, y);
    }
    for(int i = 0; i < K; i++){
        ll x, y;
        cin >> x >> y;
        x--;
        y--;
        r[x].push_back(y);
        r[y].push_back(x);
    }
    for(int i = 0; i < N; i++){
        ll ans = U.size(i) - fre[i] - 1;
        for(int j = 0; j < r[i].size; j++){
            if(U.same(v, i)) ans--;
        }
        cout << ans << " ";
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:33: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   72 |         for(int j = 0; j < r[i].size; j++){
      |                            ~~~~~^~~~
      |                                     ()
a.cc:73:23: error: 'v' was not declared in this scope
   73 |             if(U.same(v, i)) ans--;
      |                       ^
Language: C++

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

struct UnionFind{
  vector<int> Par;
 
  //N個の独立した根として初期化
  UnionFind(int N) : Par(N) {
    for( int i = 0; i < N; i++ ) Par.at(i) = -1;
  }
 
  //どこの根に属するか得る再帰関数
  int root(int X){
    if( Par.at(X) < 0 ) return X;
    else return Par.at(X) = root(Par.at(X));
  }
 
  //XとYが同じ根に属するか判定
  bool same(int X, int Y){
    return root(X) == root(Y);
  }
 
  //XとYの木を合体　サイズを持つ
  bool merge(int X, int Y){
    X = root(X);
    Y = root(Y);
    if( X == Y ) return false;
    if( Par.at(X) > Par.at(Y) ) swap(X, Y); //小さいほうから大きいほうに繋ぎ変える
    Par.at(X) += Par.at(Y);
    Par.at(Y) = X;
    return true;
  }
 
  //所属する木のサイズを取得
  int size(int X){
    return -Par.at(root(X));
  }
};

int main() {
  int n,m,k
  cin >> n >> m >> k;
  
  vector<int> f(n);
  UnionFind Tree(n);
  rep(i,m){
    int a,b;
    cin >> a >> b;
    a--;
    b-;
    f[a]++;
    f[b]++;
    Tree.merge(a, b);
  }
  
  Graph block(n);
  rep(i,k){
    int c,d;
    cin >> c>> d;
    c--;
    d--;
    block[c].push_back(d);
    block[d].push_back(c);
  }
  
  rep(i,n){
    int ans = Tree.size(i)-f[i];
    rep(j,block[i].size()){
      if(Tree.same(i,block[i][j]) ) ans--;
    }
    cout << ans-1 << " ";
  }
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:3: error: expected initializer before 'cin'
   46 |   cin >> n >> m >> k;
      |   ^~~
a.cc:54:7: error: expected primary-expression before ';' token
   54 |     b-;
      |       ^
a.cc:61:9: error: 'k' was not declared in this scope
   61 |   rep(i,k){
      |         ^
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i,n)for(long long i=0;i<(n);i++)
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++) 
#define rep(i,n); for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b); 
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e10+10;

/*----------------------------------------------*/
vi fri[101010];
bool blo[101010][101010];
int ans[101010];
bool reached[101010][101010];
bool frie[101010][101010];

void check(int x,int u,int p=-1){
  for(auto v:fri[u]){
    if(v==p||v==x) continue;
    if(reached[x][v]) continue;
    for(auto k:fri[x])if(k==v) ans[x]--;
    if(blo[x][v]) ans[x]--;
    ans[x]++;
    
    reached[x][v]=true;
    check(x,v,u);
  }
}

signed main(){
  int n,m,k;
  cin>>n>>m>>k;
  rep(i,m){
    int a,b;
    cin>>a>>b;
    a--;b--;
    fri[a].push_back(b);
    fri[b].push_back(a);
    frie[a][b]=true;
    frie[b][a]=true;
  }
  rep(i,k){
    int a,b;
    cin>>a>>b;
    a--;b--;
    blo[a][b]=true;
    blo[b][a]=true;
  }
  rep(i,n){
    check(i,i);
  }

  rep(i,n){
    if(i)cout<<" ";
    cout<<ans[i];
  }
  cout<<endl;
  
  return 0;
}

Compiler output:
/tmp/ccwfBrjS.o: in function `check(long long, long long, long long)':
a.cc:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against symbol `reached' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x19c): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x1b7): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x214): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x22f): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x246): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x261): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x27e): relocation truncated to fit: R_X86_64_PC32 against symbol `reached' defined in .bss section in /tmp/ccwfBrjS.o
/tmp/ccwfBrjS.o: in function `main':
a.cc:(.text+0x3c8): relocation truncated to fit: R_X86_64_PC32 against symbol `frie' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x3e7): relocation truncated to fit: R_X86_64_PC32 against symbol `frie' defined in .bss section in /tmp/ccwfBrjS.o
a.cc:(.text+0x50e): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef std::pair<int,int> pair2;
typedef std::pair<int,pair2> pair3;
const ll INF = 1LL<<60;

int main(){

int N,M,K;
  cin>>N>>M>>K;
  int ans[N][N]={0};
  vector<vector<int>> frm;
  vector<int> a(M);
vector<int> b(M);
  for(int i=0;i<M;i++){
  cin>>a[i]>>b[i];
    ans[a[i]-1][b[i]-1]=1;
    ans[b[i]-1][a[i]-1]=1;
    frm[a[i]].push_back(b[i]);
    frm[b[i]].push_back(a[i]);
  }
vector<int> c(K);
vector<int> d(K);
  for(int i=0;i<K;i++){
  cin>>c[i]>>d[i];
    ans[c[i]-1][d[i]-1]=-1;
    ans[d[i]-1][c[i]-1]=-1;
  }
  

  
      // BFS のためのデータ構造
    vector<int> dist(N, -1); // 全頂点を「未訪問」に初期化
    queue<int> que;
    vector<int>check;
      // 初期条件 (頂点 0 を初期ノードとする)
    dist[0] = 0;
    que.push(1); // 0 を橙色頂点にする
    check.push_back(1);
  
  int flag=0;
  while(flag=0){
      // BFS 開始 (キューが空になるまで探索を行う)
    while (!que.empty()) {
        int v = que.front(); // キューから先頭頂点を取り出す
        que.pop();

        // v から辿れる頂点をすべて調べる
        for (int nv : frm[v]) {
            if (dist[nv-1] != -1) continue; // すでに発見済みの頂点は探索しない

            // 新たな白色頂点 nv について距離情報を更新してキューに追加する
            dist[nv-1] = 0;
            que.push(nv);
		    check.push_back(nv);
        }
    }
  	std::sort(check.begin(),check.end());//昇順ソート
    for(int vv:check[vv]){
      for(int mm:check[mm]){
        if(ans[vv-1][mm-1]==0)ans[vv-1][mm-1]=2;
      }      
    }
  check.clear();
    for(int i=0;i<N;i++){
     if(dist[i]==-1){dist[i]=0;que.push(i+1);check.push_back(i+1);break;}
    }
    
    if(i==N){break;}
  }
  
  for(int i=0;i<N;i++){
int count=0;
    for(int j=0;j<N;j++){
        if(list[i][j]==2)count++;
  }
cout<<count-1<<" ";  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:22: error: 'vv' was not declared in this scope
   60 |     for(int vv:check[vv]){
      |                      ^~
a.cc:61:24: error: 'mm' was not declared in this scope
   61 |       for(int mm:check[mm]){
      |                        ^~
a.cc:70:8: error: 'i' was not declared in this scope
   70 |     if(i==N){break;}
      |        ^
a.cc:76:16: error: expected unqualified-id before '[' token
   76 |         if(list[i][j]==2)count++;
      |                ^
a.cc:79:2: error: expected '}' at end of input
   79 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<long long>>;

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

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

long long main() {
    // 頂点数と辺数、s と t
    long long N, M, s, t, k;
    cin >> N >> M >> k;
    long long n = N;

    // グラフ入力受取
    Graph G(N);
    bool block[n][n];
    bool ff[n][n];
    for(long long i=0;i<n;i++){
        for(long long j=0;j<n;j++){
            block[i][j] = false;
            ff[i][j] = false;
        }
    }
    for (long long i = 0; i < M; ++i) {
        long long a, b;
        cin >> a >> b;
        a--;
        b--;
        G[a].push_back(b);
        G[b].push_back(a);
        ff[a][b] = true;
        ff[b][a] = true;
    }
    for (long long i = 0; i < k; ++i) {
        long long a, b;
        cin >> a >> b;
        a--;
        b--;
        block[a][b] = true;
        block[b][a] = true;
    }

    for(long long i=0;i<n;i++){
        // 頂点 s をスタートとした探索
        seen.assign(N, false); // 全頂点を「未訪問」に初期化
        dfs(G, i);
        long long ans = 0;
        for(long long j=0;j<n;j++){
            if(i == j)continue;
            if(seen[j]){
                if(!block[i][j] && !ff[i][j])ans++;
            }
        }
        cout << ans << endl;
    }
    
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main() {
  int N, M, K;
  cin >> N >> M >> K;
  vector <int> A(M), B(M), C(K), D(K);
  rep(i, M) cin >> A[i] >> B[i];
  rep(i, K) cin >> C[i] >> D[i];
  
  vector<set<int>> V(N);
  rep(i, N) {
    int con=1;
    rep(j, i) {
      int size = V[j].size();
      rep(k, size) if((V[j])[k]==i) {
        con=0;
        break;
      }
    }
    if(con==0) continue;
    
    V[i].claer();
    V[i].insert(i);
    
    rep(j, M) {
      if(A[j]==i) V[i].insert(B[j]);  
      if(B[j]==i) V[i].insert(A[j]);
    }
  }
  
  rep(i, N) {
    set<int> U = V[i];
    int size = V[i].size();
    rep(j, size) {
      rep(k, M){
        if(A[k]==i && B[k]==(V[i])[j]) V[i].erase((V[i])[j]);
         }
    }
  
  cout << V[1].size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::set<int> >, std::set<int> >::value_type' {aka 'std::set<int>'} and 'int')
   17 |       rep(k, size) if((V[j])[k]==i) {
      |                             ^
a.cc:24:10: error: '__gnu_cxx::__alloc_traits<std::allocator<std::set<int> >, std::set<int> >::value_type' {aka 'class std::set<int>'} has no member named 'claer'; did you mean 'clear'?
   24 |     V[i].claer();
      |          ^~~~~
      |          clear
a.cc:38:35: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::set<int> >, std::set<int> >::value_type' {aka 'std::set<int>'} and 'int')
   38 |         if(A[k]==i && B[k]==(V[i])[j]) V[i].erase((V[i])[j]);
      |                                   ^
a.cc:38:57: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::set<int> >, std::set<int> >::value_type' {aka 'std::set<int>'} and 'int')
   38 |         if(A[k]==i && B[k]==(V[i])[j]) V[i].erase((V[i])[j]);
      |                                                         ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>

using namespace std;
const int NUM_MAX = 1e5 + 1;
int matrix[NUM_MAX][NUM_MAX] = {};
int N, M, K;

void step(vector<int>& ans, vector< vector<int> >& edges, vector<int>& state, int node){
    queue<int> S;
    S.push(node);
    state[node] = 1;
    vector<int> nodes;
    nodes.push_back(node);
    while(!S.empty()){
        int v = S.front();
        S.pop();
        for(int u : edges[v]){
            if(state[u] == 0){
                state[u] = 1;
                for(int i : nodes){
                    if(matrix[i][u] == 0){
                        ++ans[i];
                        ++ans[u];
                    }
                }
                nodes.push_back(u);
                S.push(u);
            }
        }
    }
}

void dfs(vector<int>& ans, vector< vector<int> >& edges)
{
    vector<int> state(N);
    for(int i=0;i<N;++i){
        if(state[i] == 0) step(ans, edges, state, i);
    }
}

int main()
{
    cin >> N >> M >> K;
    vector< vector<int> > edges(N);
    vector<int> ans(N);
    int x, y;
    for(int i=0;i<M;++i){
        cin >> x >> y;
        --x;
        --y;
        edges[x].push_back(y);
        edges[y].push_back(x);
        matrix[x][y] = 1;
        matrix[y][x] = 1;
    }
    for(int i=0;i<K;++i){
        cin >> x >> y;
        --x;
        --y;
        matrix[x][y] = 1;
        matrix[y][x] = 1;
    }

    dfs(ans, edges);
    for(int i=0;i<N;++i){
        if(i) cout << " ";
        cout << ans[i];
    }
    cout << endl;
}


Compiler output:
/tmp/ccm0skPd.o: in function `dfs(std::vector<int, std::allocator<int> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&)':
a.cc:(.text+0x32a): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x397): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
/tmp/ccm0skPd.o: in function `main':
a.cc:(.text+0x3f5): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x411): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x426): relocation truncated to fit: R_X86_64_PC32 against symbol `K' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x441): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x474): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x58b): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x63a): relocation truncated to fit: R_X86_64_PC32 against symbol `K' defined in .bss section in /tmp/ccm0skPd.o
a.cc:(.text+0x6b0): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccm0skPd.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>

using namespace std;
const int NUM_MAX = 1e5 + 1;
int ans[NUM_MAX] = {};
int matrix[NUM_MAX][NUM_MAX] = {};
int N, M, K;

void step(vector< vector<int> >& edges, vector<int>& state, int node){
    queue<int> S;
    S.push(node);
    state[node] = 1;
    vector<int> nodes;
    nodes.push_back(node);
    while(!S.empty()){
        int v = S.front();
        S.pop();
        for(int u : edges[v]){
            if(state[u] == 0){
                state[u] = 1;
                for(int i : nodes){
                    if(matrix[i][u] == 0){
                        ++ans[i];
                        ++ans[u];
                    }
                }
                nodes.push_back(u);
                S.push(u);
            }
        }
    }
}

void dfs(vector< vector<int> >& edges)
{
    vector<int> state(N);
    for(int i=0;i<N;++i){
        if(state[i] == 0) step(edges, state, i);
    }
}

int main()
{
    cin >> N >> M >> K;
    vector< vector<int> > edges(N);
    int x, y;
    for(int i=0;i<M;++i){
        cin >> x >> y;
        --x;
        --y;
        edges[x].push_back(y);
        edges[y].push_back(x);
        matrix[x][y] = 1;
        matrix[y][x] = 1;
    }
    for(int i=0;i<K;++i){
        cin >> x >> y;
        --x;
        --y;
        matrix[x][y] = 1;
        matrix[y][x] = 1;
    }

    dfs(edges);
    for(int i=0;i<N;++i){
        if(i) cout << " ";
        cout << ans[i];
    }
    cout << endl;
}


Compiler output:
/tmp/cc6Iz1xV.o: in function `dfs(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&)':
a.cc:(.text+0x341): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x3ad): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc6Iz1xV.o
/tmp/cc6Iz1xV.o: in function `main':
a.cc:(.text+0x40b): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x427): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x43c): relocation truncated to fit: R_X86_64_PC32 against symbol `K' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x457): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x56e): relocation truncated to fit: R_X86_64_PC32 against symbol `M' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x61d): relocation truncated to fit: R_X86_64_PC32 against symbol `K' defined in .bss section in /tmp/cc6Iz1xV.o
a.cc:(.text+0x68c): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc6Iz1xV.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define endl '\n'
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll MOD = 1000000007;
const double PI = 3.141592653589793238463;
const ll N=1e5+1;
set<int>fr[N];
set<int>en[N];
bool a[N][N];
ll ans[N];
bool visited[N];
set<int>kl;
void dfs(int x)
{
    visited[x]=true;
    for (auto i=kl.begin();i!=kl.end();i++){
        if (a[*i][x]==0){
            ans[*i]++;
            ans[x]++;
        }
    }
    kl.insert(x);
    for (auto i=fr[x].begin();i!=fr[x].end();i++){
        if (!visited[*i])
            dfs(*i);
    }
}
int main()
{
    FASTINOUT;
    int x,m,k;
    cin>>x>>m>>k;
    int l,r;
    for (int i=0; i<m; i++)
    {
        cin>>l>>r;
        fr[l].insert(r);
        fr[r].insert(l);
        a[l][r]=1;
        a[r][l]=1;
    }
    for (int i=0; i<k; i++)
    {
        cin>>l>>r;
        en[l].insert(r);
        en[r].insert(l);
        a[l][r]=2;
        a[r][l]=2;
    }
    for (int i=1;i<=x;i++){
        if (!visited[i]){
            kl.clear();
            dfs(i);
        }
    }
    for (int i=1;i<=x;i++)
        cout<<ans[i]<<" ";
    return 0;
}


Compiler output:
/tmp/ccF93AP9.o: in function `dfs(int)':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `kl' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0xba): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0xef): relocation truncated to fit: R_X86_64_PC32 against symbol `kl' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0x124): relocation truncated to fit: R_X86_64_PC32 against symbol `kl' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0x16e): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccF93AP9.o
/tmp/ccF93AP9.o: in function `main':
a.cc:(.text+0x430): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/ccF93AP9.o
a.cc:(.text+0x442): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Graph = vector< vector<int> >;

bool exclude_list[100000 + 5][100000 + 5] = {{false}};
vector<int> friend_candidate(100000, 0);
vector<bool> is_reached;

void dfs(Graph& g, int n, int s) {
    is_reached[n] = true;
    if(n != s && !exclude_list[n][s]) {
        friend_candidate[s]++;
    }
    for(auto next : g[n]) {
        if(is_reached[next]) continue;
        dfs(g, next, s);
    }
}

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

    Graph g(n);
    for(int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
        exclude_list[a][b] = true;
        exclude_list[b][a] = true;
    }
    for(int i = 0; i < k; i++) {
        int c, d;
        cin >> c >> d;
        c--; d--;
        exclude_list[c][d] = true;
        exclude_list[d][c] = true;
    }

    for(int i = 0; i < n; i++) {
        is_reached.assign(n, false);
        dfs(g, i, i);
    }

    for(int i = 0; i < n; i++) {
        cout << friend_candidate[i] << " ";
    }
    cout << endl;

    return 0;
}

Compiler output:
/tmp/ccqHyklB.o: in function `dfs(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, int, int)':
a.cc:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against symbol `is_reached' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0x7e): relocation truncated to fit: R_X86_64_PC32 against symbol `friend_candidate' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0xe8): relocation truncated to fit: R_X86_64_PC32 against symbol `is_reached' defined in .bss section in /tmp/ccqHyklB.o
/tmp/ccqHyklB.o: in function `main':
a.cc:(.text+0x35b): relocation truncated to fit: R_X86_64_PC32 against symbol `is_reached' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0x39b): relocation truncated to fit: R_X86_64_PC32 against symbol `friend_candidate' defined in .bss section in /tmp/ccqHyklB.o
/tmp/ccqHyklB.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x474): relocation truncated to fit: R_X86_64_PC32 against symbol `friend_candidate' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0x49a): relocation truncated to fit: R_X86_64_PC32 against symbol `friend_candidate' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0x4b3): relocation truncated to fit: R_X86_64_PC32 against symbol `is_reached' defined in .bss section in /tmp/ccqHyklB.o
a.cc:(.text+0x4cc): relocation truncated to fit: R_X86_64_PC32 against symbol `is_reached' defined in .bss section in /tmp/ccqHyklB.o
collect2: error: ld returned 1 exit status
Language: C++

// C++ program to check if there is exist a path between two vertices 
// of a graph. 
#include<iostream> 
#include <list> 
#include<bits/stdc++.h>
using namespace std; 

// This class represents a directed graph using adjacency list 
// representation 
class Graph 
{ 
	int V; // No. of vertices 
	list<int> *adj; // Pointer to an array containing adjacency lists 
public: 
	Graph(int V); // Constructor 
	void addEdge(int v, int w); // function to add an edge to graph 
	bool isReachable(int s, int d); 
}; 

Graph::Graph(int V) 
{ 
	this->V = V; 
	adj = new list<int>[V]; 
} 

void Graph::addEdge(int v, int w) 
{ 
	adj[v].push_back(w); // Add w to v’s list. 
} 

// A BFS based function to check whether d is reachable from s. 
bool Graph::isReachable(int s, int d) 
{ 
	// Base case 
	if (s == d) 
	return true; 

	// Mark all the vertices as not visited 
	bool *visited = new bool[V]; 
	for (int i = 0; i < V; i++) 
		visited[i] = false; 

	// Create a queue for BFS 
	list<int> queue; 

	// Mark the current node as visited and enqueue it 
	visited[s] = true; 
	queue.push_back(s); 

	// it will be used to get all adjacent vertices of a vertex 
	list<int>::iterator i; 

	while (!queue.empty()) 
	{ 
		// Dequeue a vertex from queue and print it 
		s = queue.front(); 
		queue.pop_front(); 

		// Get all adjacent vertices of the dequeued vertex s 
		// If a adjacent has not been visited, then mark it visited 
		// and enqueue it 
		for (i = adj[s].begin(); i != adj[s].end(); ++i) 
		{ 
			// If this adjacent node is the destination node, then 
			// return true 
			if (*i == d) 
				return true; 

			// Else, continue to do BFS 
			if (!visited[*i]) 
			{ 
				visited[*i] = true; 
				queue.push_back(*i); 
			} 
		} 
	} 
	
	// If BFS is complete without visiting d 
	return false; 
} 

// Driver program to test methods of graph class 
int main() 
{ 
	// Create a graph given in the above diagram 
	int n,m,k,i,j,a=0;
	cin>>n>>m>>k;
	Graph g(m+1); 
	vector<pair<int,int> > fr,br;
	int x[n+1][n+1]={0},z[n+1][n+1]={0};
	for(i=0;i<m;i++)
	{
		int a,b;
		cin>>a>>b;
		x[a-1][b-1]=1;
		x[b-1][a-1]=1;
		g.addEdge(a-1,b-1);
		g.addEdge(b-1,a-1);
		
	}
	for(i=0;i<k;i++)
	{
		int a,b;
		cin>>a>>b;
		z[a-1][b-1]=1;
		z[b-1][a-1]=1;
	}
	if( g.isReachable(0,8)==true)
	int arr[n+2]={0},gg=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			if(x[i][j]==0  && z[i][j]==0 && g.isReachable(i,j)==true)
			{
				arr[i]++;arr[j]++;
			}
		}
	}
	
	for(i=0;i<n;i++)
	{
		cout<<arr[i]<<" ";
	}
	
	

	

	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:116:33: error: 'arr' was not declared in this scope
  116 |                                 arr[i]++;arr[j]++;
      |                                 ^~~
a.cc:123:23: error: 'arr' was not declared in this scope
  123 |                 cout<<arr[i]<<" ";
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

typedef long long ll;
typedef pair<ll, ll> p;

struct UnionFind {
  // 要素に対応する値は自分の根。根は要素数の-1倍したものを代入する。
  // 根ならそのグループの要素数(負)が、子であれば親の番号が入る。初期値-1。
  vector<int> uni;
  UnionFind(){
    uni = vector<int>(100100, -1);
  }

  // 頂点aの所属するグループを調べる。
  int root(int a)
  {
    // uni[a]が負の値なら親はa自身
    if (uni[a] < 0) return a;
    // 正の値であれば、親ルートを調べ戻り値で根に直接つなぐ。
    else {
      uni[a] = root(uni[a]);
      return uni[a];
      // return uni[a] = root(uni[a]);
    }
  }

  // 頂点aとbをつなぐ、もともと同じグループの場合falseを返す。
  bool connect(int a, int b)
  {
    a = root(a);
    b = root(b);
    if (a == b) return false;

    // aを大きなグループにしたいので、逆であれば入れ替える。
    if (uni[a] > uni[b])
    {
      int hoge = a;
      a = b;
      b = hoge;
    }

    //aとbを結合し、bをaの親とする。
    uni[a] += uni[b];
    uni[b] = a;
    return true;
  }

  //  頂点a, bが同じグループか
  bool isConnect(int a, int b)
  {
    return root(a) == root(b);
  }

  // 頂点aを含むグループの頂点数を調べる
  int size(int a)
  {
    return -uni[root(a)];
  }

};


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<p> friends(m), block(k);
  vector<int> dir(n);
  map<int, vector<int>> mp;
  rep(i, m){
    cin >> friends[i].first >> friends[i].second;
    friends[i].first--; friends[i].second--;
    dir[friends[i].first]++;
    dir[friends[i].second]++;
  }
  rep(i, k){
    cin >> block[i].first >> block[i].second;
    block[i].first--; block[i].second--;
    mp[block[i].first].push_back(block[i].second);
    mp[block[i].second].push_back(block[i].first);
  }

  UnionFind uf;
  UnionFind uf2;

  rep(i, m){
    uf.connect(friends[i].first, friends[i].second);
  }

  rep(i, k){
    uf2.connect(block[i].first, block[i].second);
  }

  rep(i, n){
    int count = 0;
    for(auto a : mp[i]){
      // cout << a << endl;
      count += (uf2.isConnect(i, a) && uf.isConnect(i, a));
    }
    // cout << count << endl;
    cout << max(0, uf.size(i)-1 - dir[i] - count) << ' ';
  }
  cout << endl;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep2(i,st,ed) for(int i = st; i < ed; ++i)
#define mk(x,y) make_pair(x,y)
#define pb(x) push_back(x)
const ll mod = 1e5+3;
const ll N = 1e5 + 200;
const ll INF = 9999999999999;
const double eps = 1e-7;

int par[N];
int ran[N];
int roots(int v){return par[v] < 0 ? v : (par[v] = roots(par[v]));}
void merge(int x, int y ){
    if( (x = roots(x)) == (y = roots(y))) return;
    if(par[y] < par[x]) swap(x,y);
    par[x] += par[y];
    ran[x] += ran[y];
    par[y] = x;
}
int g[N][N];
int num[N];
int main(){
    int n,m,k;
    memset(par, -1, sizeof(par));
    cin>>n>>m>>k;
    rep(i,n){
        ran[i] = 1;
    }
    int x,y;
    rep(i,m){
        cin>>x>>y;
        num[x]++;
        merge(x,y);
    }
    rep(i,k){
        cin>>x>>y;
        g[x][y] = 1;
    }
    for(int i = 1; i <= n; i++){
        if(i != 1)cout<<" ";
        else{
            // cout<<ran[i] - 
        }
    }
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep2(i,st,ed) for(int i = st; i < ed; ++i)
#define mk(x,y) make_pair(x,y)
#define pb(x) push_back(x)
const ll mod = 1e5+3;
const ll N = 1e5 + 200;
const ll INF = 9999999999999;
const double eps = 1e-7;

int par[N];
int ran[N];
int root(int v){return par[v] < 0 ? v : (par[v] = root(par[v]));}
void merge(int x, int y ){
    if( (x = root(x)) == (y = root(y))) return;
    if(par[y] < par[x]) swap(x,y);
    par[x] += par[y];
    ran[x] += ran[y];
    par[y] = x;
}
int g[N][N];
int num[N];
int main(){
    int n,m,k;
    memset(par, -1, sizeof(par));
    cin>>n>>m>>k;
    rep(i,n){
        ran[i] = 1;
    }
    int x,y;
    rep(i,m){
        cin>>x>>y;
        num[x]++;
        merge(x,y);
    }
    rep(i,k){
        cin>>x>>y;
        g[x][y] = 1;
    }
    for(int i = 1; i <= n; i++){
        if(i != 1)cout<<" ";
        else{
            // cout<<ran[i] - 
        }
    }
    return 0;
}

Compiler output:
/tmp/ccQpZ4vq.o: in function `main':
a.cc:(.text+0x27a): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccQpZ4vq.o
a.cc:(.text+0x291): relocation truncated to fit: R_X86_64_PC32 against symbol `num' defined in .bss section in /tmp/ccQpZ4vq.o
collect2: error: ld returned 1 exit status