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

#include <stdio.h>
#define FOR(i,a,n) for(int i=a;i<n;i++)
int g[100000][100000];
int size[100000];
int color[100000];
int visited[100000];
int c,d;
void dfs(int v,int n){
    color[v]=c;
    if(n==d) return;
    visited[v]=1;
    FOR(i,0,size[v]){
        if(!visited[g[v][i]]){
            dfs(g[v][i],n+1);
        }
    }
    visited[v]=0;
    return;
}
int main(void){
    int n,m,q;
    int a,b;
    int v;
    scanf("%d %d",&n,&m);
    FOR(i,0,m){
        scanf("%d %d",&a,&b);
        g[a][size[a]++]=b,g[b][size[b]++]=a;
    }
    scanf("%d",&q);
    FOR(i,0,q){
        scanf("%d %d %d",&v,&d,&c);
        dfs(v,0);
    }
    FOR(i,1,n+1) printf("%d\n",color[i]);
}

Compiler output:
/tmp/cciDbt6W.o: in function `dfs':
main.c:(.text+0x10): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x2e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x93): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0xe8): relocation truncated to fit: R_X86_64_PC32 against symbol `size' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x108): relocation truncated to fit: R_X86_64_PC32 against symbol `visited' defined in .bss section in /tmp/cciDbt6W.o
/tmp/cciDbt6W.o: in function `main':
main.c:(.text+0x17e): relocation truncated to fit: R_X86_64_PC32 against symbol `size' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x196): relocation truncated to fit: R_X86_64_PC32 against symbol `size' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x1d5): relocation truncated to fit: R_X86_64_PC32 against symbol `size' defined in .bss section in /tmp/cciDbt6W.o
main.c:(.text+0x1ed): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<cstdlib>
#include<list>
#include<set>
#include<numeric>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int N, M, Q;
vector<int> G[100010];
int dp[11][100010];
int color[100010];

int main() {
	cin >> N >> M;
	memset(dp, 0, sizeof(dp));
	for (int i = 0; i < M; i++) {
		int a, b;
		scanf_s("%d %d",&a,&b);
		a--,b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	cin >> Q;
	for (int i = 1; i <= Q; i++) {
		int v, d;
		scanf_s("%d %d %d",&v,&d,&color[i]);
		v--;
		dp[d][v] = max(dp[d][v], i);
	}
	
	for (int i = 10; i > 0; i--) {
		for (int j = 0; j < N; j++) {
			dp[i - 1][j] = max(dp[i - 1][j], dp[i][j]);
			for (int &to: G[j]) {
				dp[i - 1][to] = max(dp[i - 1][to], dp[i][j]);
			}
		}
	}

	for (int i = 0; i < N; i++) {
		printf("%d\n",color[dp[0][i]]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   31 |                 scanf_s("%d %d",&a,&b);
      |                 ^~~~~~~
      |                 scanf
a.cc:40:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   40 |                 scanf_s("%d %d %d",&v,&d,&color[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long LL;
 
const int nmax = 100010; const LL mod = 1000003;
 
int N,M,c[nmax],lg[2005][2005],w,as[nmax];
vector<int>G[nmax];

void fct(int nod,tata,int d,int cul){
 if(d >= 0&&!c[nod])c[nod] = cul;
 if(!d) return;
 
  for(auto it: G[nod])
   if(it != tata)
    fct(it,nod,d-1,cul);
}
 
int main(void){
   int i,j,x,y,T,z,t,e,nod,dist,cul;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);
   cin >> N >> M;
   for(i = 1; i <= M; ++i){
      cin >> x >> y;
      G[x].push_back(y);
      G[y].push_back(x);
   }
   
   cin >> T;
   for(i =1 ; i <= T; ++i)
      cin >> as[0] >> as[1] >> as[2];
   while(T--)
    fct(as[T],0,as[1],as[2]);
  
   for(i = 1; i <= N; ++i)
      cout << c[i] << '\n';
    return 0;
}

Compiler output:
a.cc:12:18: error: 'tata' has not been declared
   12 | void fct(int nod,tata,int d,int cul){
      |                  ^~~~
a.cc: In function 'void fct(int, int, int, int)':
a.cc:17:13: error: 'tata' was not declared in this scope
   17 |    if(it != tata)
      |             ^~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long LL;
 
const int nmax = 100010; const LL mod = 1000003;
 
int N,M,c[nmax],lg[2005][2005],w,as[nmax];
vector<int>G[nmax];

void fct(int nod,,tata,int d,int cul){
 if(d >= 0&&!c[nod])c[nod] = cul;
 if(!d) return;
 
  for(auto it: G[nod])
   if(it != tata)
    fct(it,nod,d-1,cul);
}
 
int main(void){
   int i,j,x,y,T,z,t,e,nod,dist,cul;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);
   cin >> N >> M;
   for(i = 1; i <= M; ++i){
      cin >> x >> y;
      G[x].push_back(y);
      G[y].push_back(x);
   }
   
   cin >> T;
   for(i =1 ; i <= T; ++i)
      cin >> as[0] >> as[1] >> as[2];
   while(T--)
    fct(as[T],0,as[1],as[2]);
  
   for(i = 1; i <= N; ++i)
      cout << c[i] << '\n';
    return 0;
}

Compiler output:
a.cc:12:18: error: expected identifier before ',' token
   12 | void fct(int nod,,tata,int d,int cul){
      |                  ^
a.cc:12:19: error: 'tata' has not been declared
   12 | void fct(int nod,,tata,int d,int cul){
      |                   ^~~~
a.cc: In function 'void fct(int, int, int, int, int)':
a.cc:17:13: error: 'tata' was not declared in this scope
   17 |    if(it != tata)
      |             ^~~~
a.cc:18:8: error: too few arguments to function 'void fct(int, int, int, int, int)'
   18 |     fct(it,nod,d-1,cul);
      |     ~~~^~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | void fct(int nod,,tata,int d,int cul){
      |      ^~~
a.cc: In function 'int main()':
a.cc:37:8: error: too few arguments to function 'void fct(int, int, int, int, int)'
   37 |     fct(as[T],0,as[1],as[2]);
      |     ~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | void fct(int nod,,tata,int d,int cul){
      |      ^~~
Language: C

#include <iostream>
#include <vector>
#define REP(i, a, n) for(int i = (a); i <= (n); i++)
using namespace std;

int N, M, Q, v[100001], d[100001], c[100001];
vector<int> E[100001];
int dp[11][100001];

void dfs(int v, int d, int c) {
  dp[d][v] = c;
  if(d == 0) return;
  if(dp[d - 1][v] == 0) dfs(v, d - 1, c);
  for(int u : E[v]) if(dp[d - 1][u] == 0) dfs(u, d - 1, c);
}

int main(void) {
  cin >> N >> M;
  REP(i, 1, M) {
    int a, b; cin >> a >> b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  cin >> Q;
  REP(i, 1, Q) cin >> v[i] >> d[i] >> c[i];

  REP(i, 0, 10) REP(j, 1, N) dp[i][j] = 0;
  for(int i = Q; i > 0; i--) {
    dfs(v[i], d[i], c[i]);
  }

  REP(i, 1, N) cout << dp[0][i] << endl;

  return 0;
}


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

#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;

vector<int_least32_t> nodeColor;
vector< vector<int_least32_t>> map;

int paintNode(int_least32_t origin, int_least32_t range, int_least32_t color)
{
	if(range == 0) {
		return 0;
	}

	nodeColor[origin] = color;
	for(auto& x : map[origin]) {
		paintnode(x, range - 1, color);
	}

	return 0;
}

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

	nodeColor.resize(n);
	map,resize(n);

	int_least32_t a, b;
	for(auto i = 0; i < m; ++i) {
		cin >> a >> b;
		map[a].push_back(b);
		map[b].push_back(a);
	}

	int_least32_t q;
	cin >> q;

	int_least32_t v, d, c;
	for(auto i = 0; i < q; ++i) {
		cin >> v >> d >> c;
		paintNode(v, d, q);
	}

	for(auto& x : nodeColor) {
		cout << x << endl;
	}
}


Compiler output:
a.cc: In function 'int paintNode(int_least32_t, int_least32_t, int_least32_t)':
a.cc:18:17: error: 'paintnode' was not declared in this scope; did you mean 'paintNode'?
   18 |                 paintnode(x, range - 1, color);
      |                 ^~~~~~~~~
      |                 paintNode
a.cc: In function 'int main()':
a.cc:30:13: error: 'resize' was not declared in this scope; did you mean 'dysize'?
   30 |         map,resize(n);
      |             ^~~~~~
      |             dysize
Language: C++

#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;

vector<int_least32_t> nodeColor;
vector< vector<int_least32_t>> map;

int paintNode(int_least32_t origin, int_least32_t range, int_least32_t color)
{
	if(range == 0) {
		return 0;
	}

	nodeColor[origin] = color;
	for(auto& x : map[origin]) {
		paintnode(x, range - 1, color);
	}

	return 0;
}

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

	nodeColor.resize(n);
	map,resize(n);

	int_least32_t a, b;
	for(auto i = 0; i < m; ++i) {
		cin >> a >> b;
		map[a].push_back(b);
		map[b].push_back(a);
	}

	int_least32_t q;
	cin >> q;

	int_least32_t v, m, c;
	for(auto i = 0; i < q; ++i) {
		cin >> v >> m >> c;
		paintNode(v, m, q);
	}

	for(auto& x : nodeColor) {
		cout << x << endl;
	}
}


Compiler output:
a.cc: In function 'int paintNode(int_least32_t, int_least32_t, int_least32_t)':
a.cc:18:17: error: 'paintnode' was not declared in this scope; did you mean 'paintNode'?
   18 |                 paintnode(x, range - 1, color);
      |                 ^~~~~~~~~
      |                 paintNode
a.cc: In function 'int main()':
a.cc:30:13: error: 'resize' was not declared in this scope; did you mean 'dysize'?
   30 |         map,resize(n);
      |             ^~~~~~
      |             dysize
a.cc:42:26: error: redeclaration of 'int_least32_t m'
   42 |         int_least32_t v, m, c;
      |                          ^
a.cc:26:26: note: 'int_least32_t m' previously declared here
   26 |         int_least32_t n, m;
      |                          ^
Language: C++

#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;

vector<int_least32_t> nodeColor;
vector< vector<int_least32_t>> map;

int paintNode(int_least32_t origin, int_least32_t range, int_least32_t color)
{
	if(range == 0) {
		return 0;
	}

	nodeColor[origin] = color;
	for(auto& x : map[origin]) {
		paintnode(x, range - 1, color);
	}

	return 0;
}

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

	nodeColor.resize(n);
	map,resize(n);

	int_least32_t a, b;
	for(auto i = 0; i < m; ++i) {
		cin >> a >> b;
		map[a].pushback(b);
		map[b].pushback(a);
	}

	int_least32_t q;
	cin >> q;

	int_least32_t v, m, c;
	for(auto i = 0; i < q; ++i) {
		cin >> v >> m >> c;
		paintNode(v, m, q);
	}

	for(auto& x : nodeColor) {
		cout << x << endl;
	}
}


Compiler output:
a.cc: In function 'int paintNode(int_least32_t, int_least32_t, int_least32_t)':
a.cc:18:17: error: 'paintnode' was not declared in this scope; did you mean 'paintNode'?
   18 |                 paintnode(x, range - 1, color);
      |                 ^~~~~~~~~
      |                 paintNode
a.cc: In function 'int main()':
a.cc:30:13: error: 'resize' was not declared in this scope; did you mean 'dysize'?
   30 |         map,resize(n);
      |             ^~~~~~
      |             dysize
a.cc:35:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pushback'; did you mean 'push_back'?
   35 |                 map[a].pushback(b);
      |                        ^~~~~~~~
      |                        push_back
a.cc:36:24: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'class std::vector<int>'} has no member named 'pushback'; did you mean 'push_back'?
   36 |                 map[b].pushback(a);
      |                        ^~~~~~~~
      |                        push_back
a.cc:42:26: error: redeclaration of 'int_least32_t m'
   42 |         int_least32_t v, m, c;
      |                          ^
a.cc:26:26: note: 'int_least32_t m' previously declared here
   26 |         int_least32_t n, m;
      |                          ^
Language: C++

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

using namespace std;

constexpr int MaxN = 100000 + 10;
constexpr int MaxD = 10;
int n, m, q;
vector<int> E[MaxN];
int C[MaxN];
int dp[MaxN][MaxD + 1];

void MaxAssign(int &a, int b) {
    a = max(a, b);
}

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

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

    cin >> q;
    memset(dp, -1, sizeof(dp) / sizeof(int));

    for (int i = 0; i < q; i++) {
        int v, d, c;
        cin >> v >> d >> c;
        v--;
        C[i] = c;

        dp[v][d] = i;
    }

    for (int dist = 10; dist > 0; dist--) {
        for (int no = 0; no < n; no++) {
            if (dp[no][dist] >= 0) {
                for (auto& to : E[no]) {
                    MaxAssign(dp[to][dist - 1], dp[no][dist]);
                }
                MaxAssign(dp[no][dist - 1], dp[no][dist]);
            }
        }
    }

    for (int i = 0; i < n; i++) {
        int ans = dp[i][0] >= 0 ? C[dp[i][0]] : 0;
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'memset' was not declared in this scope
   30 |     memset(dp, -1, sizeof(dp) / sizeof(int));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 |
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class B {

	static Scanner scan = new Scanner(System.in);
	static int N = scan.nextInt();
	static int M = scan.nextInt();
	static int dp[][]=new int[N][N];
	static int count;

	public static void paint(int v,int c,V vs[]){
		if(count<0){return;}//探索が奥まで行ったら終了
		vs[v].color=c;
		for(int j=0;j<vs[v].size();j++){
				count--;
				paint(vs[v].get(j),c,vs);
				count++;
		}


	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		V vs[] = new V[N];
		for(int i =0;i<N;i++){
			vs[i] = new V(i);
		}


		int a;
		int b;

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

			vs[a].add(b);
			vs[b].add(a);

//			dp[a[i]][b[i]]=1;
//			dp[b[i]][a[i]]=1;
			//a_i,b_iは0 ~ N-1
			//二つがつながっていたらdp=1
		}

		int Q = scan.nextInt();
		int v[] = new int[Q];
		int d[] = new int[Q];
		int c[] = new int[Q];

		for(int i =0;i<Q;i++){
			v[i]=scan.nextInt() - 1;
			d[i]=scan.nextInt();
			c[i]=scan.nextInt();
		}

		//ここから塗りつぶし動作
		for(int i =0;i<Q;i++){
			count = d[i];
					paint(v[i],c[i],vs);

			}

		for(int i=0;i<N;i++){
			System.out.println(vs[i].color);
		}

		}

	static class V extends ArrayList<Integer>{
		int id;
		int color = 0;
		V(int _id){
			id = _id;
		}
	}



	}


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

import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[2*m];
		int[] b = new int[2*m];
		int[] color = new int[n];
		int[][] dist = new int[n][n];
		for(int i=0;i<n;i++){
			color[i] = 0;
			for(int j=0;j<n;j++){
				dist[i][j] = Integer.MAX_VALUE;
			}
			dist[i][i] = 0;
		}
		
		int x;
		int y;
		
		for(int i=0;i<m;i++){
			a[2*i] = sc.nextInt()-1;
			b[2*i] = sc.nextInt()-1;
			a[2*i+1] = b[2*i];
			b[2*i+1] = a[2*i];
			dist[a[2*i]][b[2*i]] = 1;
			dist[b[2*i]][a[2*i]] = 1;
			}
		}
		
		boolean changed = true;
		int kouho1=0;
		int kouho2=0;
		while(changed){
			changed = false;
			for(int i=0; i<2*m; i++){
				for(int j=0; j<n; j++){
					if(dist[a[i]][j] != Integer.MAX_VALUE){
						kouho1 = dist[a[i]][j]+1;
					}else{
						kouho1 = Integer.MAX_VALUE;
					}
					if(dist[b[i]][j] != Integer.MAX_VALUE){
						kouho2 = dist[b[i]][j]+1;
					}else{
						kouho2 = Integer.MAX_VALUE;
					}
					if(dist[a[i]][j] > kouho2){
						dist[a[i]][j] = kouho2;
						changed = true;
					}
					if(dist[b[i]][j] > kouho1){
						dist[b[i]][j] = kouho1;
						changed = true;
					}
				}
			}
		}
			
		int q = sc.nextInt();
		int v;
		int d;
		int c;
		for(int i=0; i<q; i++){
			v = sc.nextInt()-1;
			d = sc.nextInt();
			c = sc.nextInt();
			for(int j=0; j<n; j++){
				if(dist[v][j]<=d){
					color[j] = c;
				}
			}
			/*for(int j=0; j<n; j++){
				System.out.println(color[j]);
			}*/
		}
		
		/*for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				System.out.println("dist["+i+"]["+j+"] = "+dist[i][j]);
			}
		}*/
		
		
		for(int i=0; i<n; i++){
			System.out.println(color[i]);
		}
		return;
	}
}

Compiler output:
Main.java:36: error: illegal start of type
		while(changed){
		^
Main.java:36: error: <identifier> expected
		while(changed){
		             ^
Main.java:66: error: illegal start of type
		for(int i=0; i<q; i++){
		^
Main.java:66: error: > or ',' expected
		for(int i=0; i<q; i++){
		                ^
Main.java:66: error: <identifier> expected
		for(int i=0; i<q; i++){
		                   ^
Main.java:87: error: illegal start of type
		for(int i=0; i<n; i++){
		^
Main.java:87: error: > or ',' expected
		for(int i=0; i<n; i++){
		                ^
Main.java:87: error: <identifier> expected
		for(int i=0; i<n; i++){
		                   ^
Main.java:90: error: illegal start of type
		return;
		^
Main.java:92: error: class, interface, enum, or record expected
}
^
10 errors
Language: C++

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

const int N = 100000;
int n, m, q, color[N], a[N], b[N], v[N], d[N], c[N], used[N];
vector <vector<int>>mat(N, vector<int>(N));

void use(int node, int length, int c) {
	if (length == 0)return;
	used[node] = 1;
	for (int i = 0; i < mat[node].size(); i++) {
		if (used[i] == 0)use(i, length - 1);
	}
	color[node] = c;
}

int main() {
	cin >> n >>  m;
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		mat[a[i] - 1][b[i] - 1] = 1;
		mat[b[i] - 1][a[i] - 1] = 1;
	}
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> v[i] >> d[i] >> c[i];
	}

	for (int i = 0; i < q; i++) {
		for (int j = 0; j < n; j++)used[j] = 0;
		use(v[i] - 1, d[i], c[i]);
	}

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

Compiler output:
a.cc: In function 'void use(int, int, int)':
a.cc:13:37: error: too few arguments to function 'void use(int, int, int)'
   13 |                 if (used[i] == 0)use(i, length - 1);
      |                                  ~~~^~~~~~~~~~~~~~~
a.cc:9:6: note: declared here
    9 | void use(int node, int length, int c) {
      |      ^~~
Language: C

#include <iostream>
#include <algorithm>
#include <set>
#include <array>


using namespace std;



int n, m, q;

int v[100000], d[100000], c[100000];

array< array< set<int>, 100000> , 11> dp;

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

	for(int i = 0; i < n; i++) {
		dp[0][i].insert(i);
		dp[1][i].insert(i);
	}


	for (int i = 0; i < m; i++) {
		int ta, tb;

		cin >> ta >> tb;
		ta--; tb--;

		dp[1][ta].insert(tb);
	}

	for (int i = 2; i < 11; i++) {
		for (int j = 0; j < n; j++) {
			dp[i][j].insert(dp[i -1][j].begin(),dp[i -1][j].end());
			for (auto node : dp[i -1][j]) {
				dp[i][j].insert(dp[1][node].begin(),dp[1][node].end());
			}
		}
	}

	cin >> q;

	for (int i = 0; i< q; i++) {
		cin >> v[i] >>  d[i] >> c[i];
		v[i] --; 
	}

	for (int i = 0; i < n; i++) {
		bool find_out = false;
		for (int j = q - 1; j >= 0; j --) {

			if (dp[d[j]][v[j]].find(i) != dp[d[j]][v[j]].end()) {
				cout << c[j]  << endl;
				find_out = true;
				break;
			}
		}
		if (find_out == false) {
			cout << 0 << endl;
		}
	}
	return 0;
}


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

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
const int MaxN = 1e5;
using namespace std;
int vis[MaxN + 5][MaxN + 5] , dis[MaxN + 5][MaxN + 5];
int ans[MaxN + 5] , n , m , T;
queue<int>que;
vector<int>G[MaxN + 5];
void Init(){
	memset(vis , 0 , sizeof(vis));
	memset(ans , 0 , sizeof(ans));
	for(int i = 1;i <= MaxN;i++){
		for(int j = 1;j <= MaxN;j++){
			dis[i][j] = 1 << 30;
		}
	}
	for(int i = 1;i <= MaxN;i++) G[i].clear();
	for(int i = 1;i <= m;i++){
		int u  , v;
		scanf("%d%d" , &u , &v);
		G[u].push_back(v);
		G[v].push_back(u);
	}
}
void SPFA(int x , int z){
	vis[z][x] = 1;
	dis[z][x] = 0;
	que.push(x);
	while(que.size()){
		int now = que.front();
		que.pop();
		for(int i = 0;i < G[now].size();i++){
			int v = G[now][i];
			if(dis[z][v] > dis[z][now] + 1){
				dis[z][v] = dis[z][now] + 1;
				if(!vis[z][v]){
					vis[z][v] = 1;
					que.push(v);
				}
			}
			vis[z][now] = 0;
		}
	}
}
void Solve(){
	for(int i = 1;i <= n;i++){
		while(que.size()) que.pop();
		SPFA(i , i);
	}
	scanf("%d" , &T);
	for(int i = 1;i <= T;i++){
		int a , b , c;
		scanf("%d%d%d" , &a , &b , &c);
		for(int j = 1;j <= n;j++){
			if(dis[a][j] <= b){
				ans[j] = c;
			}
		}
	}
	for(int i = 1;i <= n;i++){
		printf("%d\n" , ans[i]);
	}
}
int main()
{
	while(~scanf("%d%d" , &n , &m)){
		Init();
		Solve();
	}
}

Compiler output:
/tmp/ccGyhThR.o: in function `Init()':
a.cc:(.text+0x36): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0xb8): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x112): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x15a): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccGyhThR.o
/tmp/ccGyhThR.o: in function `SPFA(int, int)':
a.cc:(.text+0x1c5): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x1da): relocation truncated to fit: R_X86_64_PC32 against symbol `que' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x1ee): relocation truncated to fit: R_X86_64_PC32 against symbol `que' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `que' defined in .bss section in /tmp/ccGyhThR.o
a.cc:(.text+0x230): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: Java

import java.util.Scanner;

public class B {

	static Scanner scan = new Scanner(System.in);
	static int N = scan.nextInt();
	static int M = scan.nextInt();
	static int dp[][]=new int[N][N];
	static int count;
	static int color[]=new int[N];

	public static void paint(int v,int c){
		if(count<0){return;}
		for(int j=0;j<N;j++){
			if(dp[v][j]==1){
				count--;
				paint(j,c);
				count++;

			}

		}
		color[v]=c;

	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int a[] = new int[M];
		int b[] = new int[M];

		for(int i =0;i<M;i++){
			a[i]=scan.nextInt()-1;
			b[i]=scan.nextInt()-1;
			dp[a[i]][b[i]]=1;
			dp[b[i]][a[i]]=1;
			//a_i,b_iは0 ~ N-1
			//二つがつながっていたらdp=1
		}

		int Q = scan.nextInt();
		int v[] = new int[Q];
		int d[] = new int[Q];
		int c[] = new int[Q];

		for(int i =0;i<Q;i++){
			v[i]=scan.nextInt() - 1;
			d[i]=scan.nextInt();
			c[i]=scan.nextInt();
		}

		//ここから塗りつぶし動作
		for(int i =0;i<Q;i++){
			count = d[i];
					paint(v[i],c[i]);

			}

		for(int i=0;i<N;i++){
			System.out.println(color[i]);
		}

		}

	}


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

import java.util.Scanner;

public class B {

	static Scanner scan = new Scanner(System.in);
	static int N = scan.nextInt();
	static int M = scan.nextInt();
	static int dp[][]=new int[N][N];
	static int count;
	static int color[]=new int[N];

	public static void paint(int v,int c){
		if(count<0){return;}
		for(int j=0;j<N;j++){
			if(dp[v][j]==1){
				count--;
				paint(j,c);
				count++;
				color[j]=c;
			}
		}

	}

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int a[] = new int[M];
		int b[] = new int[M];

		for(int i =0;i<M;i++){
			a[i]=scan.nextInt()-1;
			b[i]=scan.nextInt()-1;
			dp[a[i]][b[i]]=1;
			dp[b[i]][a[i]]=1;
			//a_i,b_iは0 ~ N-1
			//二つがつながっていたらdp=1
		}

		int Q = scan.nextInt();
		int v[] = new int[Q];
		int d[] = new int[Q];
		int c[] = new int[Q];

		for(int i =0;i<Q;i++){
			v[i]=scan.nextInt() - 1;
			d[i]=scan.nextInt();
			c[i]=scan.nextInt();
		}

		//ここから塗りつぶし動作
		for(int i =0;i<Q;i++){
			count = d[i];
					paint(v[i],c[i]);

			}

		for(int i=0;i<N;i++){
			System.out.println(color[i]);
		}

		}

	}


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

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define ll long long

bool grid[2001][2001] = {};
int main()
{
	int N, M, Q;
	int v[2001], d[2001], c[2001], color[2001];

	cin >> N >> M;
	REP(i, 1, M+1) {
		int x, y;
		cin >> x >> y;
		grid[x][y] = grid[y][x] = true;
	}
	cin >> Q;
	REP(i, 1, Q+1) cin >> v[i] >> d[i] >> c[i];
	memset(color, 0, sizeof color);

	REP(i, 1, Q+1) {
		bool hist[2001] = {};
		queue<int> qu;
		qu.push(v[i]);
		hist[v[i]] = true;
		color[v[i]] = c[i];

		while (!qu.empty() && d[i] > 0) {
			int q = qu.front();
			qu.pop();

			int flag = false;
			REP(j, 1, N+1) {
				if (grid[q][j] && !hist[j]) {
					qu.push(j);
					hist[j] = true;
					color[j] = c[i];
					flag = true;
				}
			}
			if(flag) d[i]--;
		}
	}

	REP(i, 1, N+1) cout << color[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'memset' was not declared in this scope
   23 |         memset(color, 0, sizeof color);
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<queue>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
#define Y second
#define FOR(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
#define N 200010
int n,m,q;
pii ans[N][11];
int M = 0, head[N], vb[N], nxt[N], vc[N];

void ins(int a,int b)
{
	nxt[++ M] = head[a];
	head[a] = M;
	vb[M]=b;
}

void insert(int a,int b)
{
	ins(a, b);
	ins(b, a);
}

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
int main()
{
	n = read();
	m = read();
	for(int i = 1; i <= m; i ++)
	{
		int a, b;
		a = read();
		b = read();
		insert(a, b);
	}
	q = read();
	for(int i = 1; i <= q; i ++)
	{
		int v, d, c;
		v = read();
		d = read();
		c = read();
		ans[v][d] = max(ans[v][d], mp(i, c));
	}
	for(int i = 10; i >= 1; i --)
		for(int j = 1; j <= n; j ++)
		{
			ans[j][i - 1] = max(ans[j][i - 1], ans[j][i]);
			FOR(j, e, b)
				ans[b][i - 1] = max(ans[b][i - 1], ans[j][i]);
		}
	for(int j = 1; j <= n; j ++)
		printf("%d\n",ans[j][0].Y);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: expected primary-expression before 'int'
    7 | #define FOR(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
      |                     ^~~
a.cc:57:25: note: in expansion of macro 'FOR'
   57 |                         FOR(j, e, b)
      |                         ^~~
a.cc:7:21: error: expected ')' before 'int'
    7 | #define FOR(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
      |                    ~^~~
a.cc:57:25: note: in expansion of macro 'FOR'
   57 |                         FOR(j, e, b)
      |                         ^~~
a.cc:57:32: error: 'e' was not declared in this scope
   57 |                         FOR(j, e, b)
      |                                ^
a.cc:7:49: note: in definition of macro 'FOR'
    7 | #define FOR(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
      |                                                 ^
a.cc:57:35: error: 'b' was not declared in this scope
   57 |                         FOR(j, e, b)
      |                                   ^
a.cc:7:64: note: in definition of macro 'FOR'
    7 | #define FOR(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
      |                                                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
#define Y second
#define esb(x,e,b) (int e = head[x], b = vb[e]; e; e = nxt[e], b = vb[e])
#define N 200010
int n,m,q;
pii ans[N][11];
int M = 0, head[N], vb[N], nxt[N], vc[N];

void ins(int a,int b)
{
	nxt[++ M] = head[a];
	head[a] = M;
	vb[M]=b;
}

void insert(int a,int b)
{
	ins(a, b);
	ins(b, a);
}

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
int main()
{
	n = read();
	m = read();
	for(int i = 1; i <= m; i ++)
	{
		int a, b;
		a = read();
		b = read();
		insert(a, b);
	}
	q = read();
	for(int i = 1; i <= q; i ++)
	{
		int v, d, c;
		v = read();
		d = read();
		c = read();
		ans[v][d] = max(ans[v][d], mp(i, c));
	}
	for(int i = 10; i >= 1; i --)
		for(int j = 1; j <= n; j ++)
		{
			ans[j][i - 1] = max(ans[j][i - 1], ans[j][i]);
			FOR(j, e, b)
				ans[b][i - 1] = max(ans[b][i - 1], ans[j][i]);
		}
	for(int j = 1; j <= n; j ++)
		printf("%d\n",ans[j][0].Y);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:32: error: 'e' was not declared in this scope
   57 |                         FOR(j, e, b)
      |                                ^
a.cc:57:35: error: 'b' was not declared in this scope
   57 |                         FOR(j, e, b)
      |                                   ^
a.cc:57:25: error: 'FOR' was not declared in this scope
   57 |                         FOR(j, e, b)
      |                         ^~~
Language: C++

#include <iostream>
#include <queue>
#include <vector>
#include <cstdio>
using namespace std;
vector<int> adj[2001];
int v[2001];
int d[2001];
int c[2001];
int check[2001];
int ans[2001];
void bfs(int i,int limit,int color){
    
    memset(check,-1,sizeof(check));
    
    check[i]=0;
    ans[i]=color;
    queue<int> q;
    
    q.push(i);
    
    while(!q.empty()){
        
        int x = q.front();
        q.pop();
        
        for(int i=0;i<adj[x].size();i++){
            int next = adj[x][i];
            
            if(check[next]== -1 && check[x] + 1 <= limit){
                
                check[next] = check[x]+1;
                q.push(next);
                ans[next] = color;
            }
            
        }
    }
    
}
int main(int argc, const char * argv[]) {
 
    
    int n,m;
    
    scanf("%d %d",&n,&m);
    
    if(n>=2001 || m>=2001) return 0;
    
    for(int i=0,x,y;i<m;i++){
        scanf("%d %d",&x,&y);
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    
    
    int q;
    scanf("%d",&q);
    if(q>=2001) return 0;
    
    for(int i=0;i<q;i++){
        scanf("%d %d %d",&v[i],&d[i],&c[i]);
    }
    
    for(int i=0;i<q;i++){
        bfs(v[i],d[i],c[i]);
    }
    
    for(int i=1;i<=n;i++){
        printf("%d\n",ans[i]);
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'void bfs(int, int, int)':
a.cc:14:5: error: 'memset' was not declared in this scope
   14 |     memset(check,-1,sizeof(check));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdio>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

struct edge {int to, cost; };
typedef pair<int, int> P;
int N, M;
vector<edge> G[100000];
int d[100000];
int INF = 99999999;
int color[100000];

void dijkstra(int s, int dd, int c){
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+N, INF);
    d[s] = 0;
    que.push(P(0, s));
    while(!que.empty()){
        P p = que.top();que.pop();
        int v = p.second;
        if(d[v] < p.first) continue;
        FOR(i, 0, G[v].size()){
            edge e = G[v][i];
            if(d[e.to] > d[v] + e.cost){
                d[e.to] = d[v] + e.cost;
                if(d[e.to]<=dd) color[e.to] = c;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

int main(){
    cin>>N>>M;
    FOR(i, 0, M){
        int a, b;
        cin>>a>>b;
        a--;b--;
        edge in;
        in.to = b;in.cost=1;
        G[a].push_back(in);
        in.to = a;in.cost=1;
        G[b].push_back(in);
    }
    int Q;
    cin>>Q;
    FOR(i, 0, N) color[i] = 0;
    FOR(i, 0, Q){
        int v, dd, c;
        cin>>v>>dd>>c;
        v--;
        dijkstra(v);
        //FOR(j, 0, N){
        //    if(d[j]<=dd) color[j] = c;
        //}
    }
    FOR(i, 0, N){
        cout << color[i] << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:17: error: too few arguments to function 'void dijkstra(int, int, int)'
   67 |         dijkstra(v);
      |         ~~~~~~~~^~~
a.cc:28:6: note: declared here
   28 | void dijkstra(int s, int dd, int c){
      |      ^~~~~~~~
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class A{

	static final Scanner	s	=new Scanner(System.in);

	static int				n, m, q;
	static boolean			checked[];
	static Node				nodes[];

	public static void main(String args[]){
		n=s.nextInt();
		m=s.nextInt();

		checked=new boolean[n];

		nodes=new Node[n];
		for(int i=0; i<n; i++)
			nodes[i]=new Node(i);

		int bufa, bufb;
		for(int i=0; i<m; i++){
			bufa=s.nextInt()-1;
			bufb=s.nextInt()-1;
			nodes[bufa].edge.add(nodes[bufb]);
			nodes[bufb].edge.add(nodes[bufa]);
		}

		q=s.nextInt();

		if(n>3000||m>3000||q>3000)// judge reject
			return;

		int v,d,c;
		for(int i=0;i<q;i++) {
			v=s.nextInt()-1;
			d=s.nextInt();
			c=s.nextInt();

			function(nodes[v],d,c);
		}
		Arrays.stream(nodes).forEach(n->System.out.println(n.color));
	}

	static ArrayDeque<Node> deque=new ArrayDeque<>();
	static Node buf;
	static void function(Node n,int maxDepth,int color) {
		deque.clear();
		Arrays.fill(checked,false);
		int curDepth=0;

		checked[n.no]=true;
		n.color=color;
		deque.add(n);

		while(curDepth<=maxDepth&&!deque.isEmpty()) {
			curDepth++;
			for(int i=deque.size();i>0;i--) {
				n=deque.poll();
				n.color=color;
				for(int j=0;j<n.edge.size();j++) {
					buf=n.edge.get(j);
					if(!checked[buf.no]) {
						checked[buf.no]=true;
						deque.add(buf);
					}
				}
			}
		}
	}
}

class Node{

	int				no, color=0;
	ArrayList<Node>	edge=new ArrayList<>();

	Node(int no){
		this.no=no;
	}
}


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

#include<vector>
using namespace std;

int n, m, q;
vector<vector<int>> vertex;
vector<int> color;

void paint(int v, int d, int c) {
	color[v] = c;
	if (d <= 0 || vertex[v].size() <= 0) 
		return;
	else {
		for (int i = 0; i < vertex[v].size(); i++) {
			paint(vertex[v][i], d-1, c);
		}
	}
}

int main() {
	cin >> n >> m;
	vertex.resize(n+1);
	color.resize(n+1);

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

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

		paint(v, d, c);
	}

	for (int i = 1; i <= n; i++)
		cout << color[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'cin' was not declared in this scope
   20 |         cin >> n >> m;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<vector>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:40:17: error: 'cout' was not declared in this scope
   40 |                 cout << color[i] << endl;
      |                 ^~~~
a.cc:40:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:37: error: 'endl' was not declared in this scope
   40 |                 cout << color[i] << endl;
      |                                     ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<vector>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c, int N) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, N) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c, N);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c, N);
        }
    }
}

int main() {
    int N, M;
    cin >> N >> M;
    REP(i, M) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c, N);
    }

    REP(i, N) {
        cout << color[i] << endl;
    }

    return 0;
}

Compiler output:
/tmp/cccSZ7lX.o: in function `ika(int, int, int, int)':
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cccSZ7lX.o
/tmp/cccSZ7lX.o: in function `main':
a.cc:(.text+0x257): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cccSZ7lX.o
collect2: error: ld returned 1 exit status
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int N, M;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, N) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

int main() {
    cin >> N >> M;
    REP(i, M) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, N) {
        cout << color[i] << endl;
    }

    return 0;
}

Compiler output:
/tmp/ccuas3tN.o: in function `ika(int, int, int)':
a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccuas3tN.o
/tmp/ccuas3tN.o: in function `main':
a.cc:(.text+0x259): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccuas3tN.o
collect2: error: ld returned 1 exit status
Language: C++

//部分点が狙えるかも、また、枝刈りで通ればいいなあ

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

typedef pair<int, int> Pi;
#define fi first
#define se second

vector < int > G[100005];

int color[100005] = {0};
int power[100005] = {0};

int N, M;

void bfs(int sv, int sd, int c) {
  
  queue < Pi > que;
  if(!color[sv]) {
    color[sv] = c;
    power[sv] = sd;
  }
  que.push(Pi(sv, sd));
  if(d == 0) return;
  
  while(!que.empty()) {
    int v = que.front().fi, d = que.front().se; que.pop();
    
    Rep(i, G[v].size()) {
      int u = G[v][i];
      
      if(!color[u]) color[u] = c, power[u] = d - 1;
      else if(d - 1 <= power[u]) continue;

      if(d > 1) {
	que.push(Pi(u, d - 1));
      }
    }
  }

  return;
}

signed main()
{
  int A, B;
  int Q;
  int v[100005], d[100005], c[100005];
  
  cin >> N >> M;

  while(M--) {
    cin >> A >> B; --A, --B;
    G[A].pb(B); G[B].pb(A);
  }

  cin >> Q;
  
  //reverseしながら読み込む
  Rep(i, Q) cin >> v[Q - i - 1] >> d[Q - i - 1] >> c[Q - i - 1];

  Rep(i, Q) {
    v[i]--;
    bfs(v[i], d[i], c[i]);
  }

  Rep(i, N) {
    cout << color[i] << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'void bfs(long long int, long long int, long long int)':
a.cc:28:6: error: 'd' was not declared in this scope; did you mean 'sd'?
   28 |   if(d == 0) return;
      |      ^
      |      sd
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n;
int m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c);

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

Compiler output:
/tmp/cchebQLz.o: in function `main':
a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cchebQLz.o
/tmp/cchebQLz.o: in function `ika(int, int, int)':
a.cc:(.text+0x1d3): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cchebQLz.o
collect2: error: ld returned 1 exit status
Language: C++

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

void wf(int n,int d[n][n]){
	int i,j,k;
	for(i=0;i<n;i++){//中点
		for(j=0;j<n;j++){//始点
			for(k=0;k<n;k++){//終点
				//printf("%d->%d->%d\n",j,i,k);
				if(d[j][k]>d[j][i]+d[i][k]){
					//printf("get shorter! %d->%d\n",d[j][k],d[j][i]+d[i][k]);
					d[j][k]=d[j][i]+d[i][k];
					
				}
			}
		}
	}
	return;
}

int main(){
	int n,m,i,j,k;
	scanf("%d%d",&n,&m);
	int matrix[n][n];
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			matrix[i][j]=1000000;
		}
		matrix[i][i]=0;
	}
	int a,b;
	for(i=0;i<m;i++){
		scanf("%d%d",&a,&b);
		a--;
		b--;
		matrix[a][b]=1;
		matrix[b][a]=1;
	}
	
	/* for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			printf("%12d ",d[i][j]);
		}puts("");
	}puts(""); */
	
	wf(n,matrix);
	
	/* for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			printf("%12d ",d[i][j]);
		}puts("");
	} */
	
	int color[n];
	memset(color,0,sizeof(int)*n);
	
	int q,v,d,c;
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d%d%d",&v,&d,&c);
		v--;
		for(j=0;j<n;j++){
			if(matrix[v][j]<=d){
				color[j]=c;
			}
		}
	}
	
	for(i=0;i<n;i++){
		printf("%d\n",color[i]);
	}
	
    return 0;
}


Compiler output:
a.cc:9:22: error: use of parameter outside function body before ']' token
    9 | void wf(int n,int d[n][n]){
      |                      ^
a.cc:9:25: error: use of parameter outside function body before ']' token
    9 | void wf(int n,int d[n][n]){
      |                         ^
a.cc: In function 'void wf(...)':
a.cc:11:19: error: 'n' was not declared in this scope
   11 |         for(i=0;i<n;i++){//中点
      |                   ^
a.cc:15:36: error: 'd' was not declared in this scope
   15 |                                 if(d[j][k]>d[j][i]+d[i][k]){
      |                                    ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

#define MAX_N 100001

int n, m;
int ab[MAX_N][MAX_N];
int color[MAX_N];

void ika(int v, int d, int c);

int main() {
    cin >> n >> m;
    REP(i, m) {
        int a, b;
        cin >> a >> b;
        ab[a-1][b-1] = 1;
        ab[b-1][a-1] = 1;
    }

//    REP(i, n) {
//        REP(j, n) {
//            cout << ab[i][j] << ' ';
//        }
//        cout << endl;
//    }

    int q;
    cin >> q;
    REP(i, q) {
        int v, d, c;
        cin >> v >> d >> c;

        ika(v, d, c);
    }

    REP(i, n) {
        cout << color[i] << endl;
    }

    return 0;
}

void ika(int v, int d, int c) {
    color[v-1] = c;

    if (d == 0) {
        return;
    }

    REP(i, n) {
        if (ab[v-1][i] == 1) {
            ika(i+1, d-1, c);
        }
        if (ab[i][v-1] == 1) {
            ika(i+1, d-1, c);
        }
    }
}

Compiler output:
/tmp/ccQZUl65.o: in function `main':
a.cc:(.text+0x16f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccQZUl65.o
/tmp/ccQZUl65.o: in function `ika(int, int, int)':
a.cc:(.text+0x1d3): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccQZUl65.o
collect2: error: ld returned 1 exit status