Language: C++

#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<algorithm>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
 
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

vector<ll> es[1000000];
vector<ll> color(1000000, 0);
ll v, d, c;

void dfs(ll vv, ll depth, vector<bool> use){
	color[vv] = c;
	use[vv] = true;
	if(depth == d) return;
	for(ll to : es[vv]){
		if(!use[to]) dfs(to, depth+1, use);
	}
}
 
signed main(){
	ll N, M, Q;
	scanf("%lld %lld", &N, &M);
	rep(M){
		ll tmp1, tmp2;
		scanf("%lld %lld", &tmp1, &tmp2);
		es[tmp1].push_back(tmp2);
		es[tmp2].push_back(tmp1);
	}
	scanf("%lld", &Q);
	rep(Q){
		scanf("%lld %lld %lld", &v, &d, &c);
		dfs(v, 0, vector<bool>(N+1, false));
	}
	rep(N){
		printf("%lld\n", color[i+1]);
	}
}


Compiler output:
a.cc:21:9: error: 'pair' does not name a type
   21 | typedef pair<ll, ll> P;
      |         ^~~~
a.cc:24:1: error: 'vector' does not name a type
   24 | vector<ll> es[1000000];
      | ^~~~~~
a.cc:25:1: error: 'vector' does not name a type
   25 | vector<ll> color(1000000, 0);
      | ^~~~~~
a.cc:28:27: error: 'vector' has not been declared
   28 | void dfs(ll vv, ll depth, vector<bool> use){
      |                           ^~~~~~
a.cc:28:33: error: expected ',' or '...' before '<' token
   28 | void dfs(ll vv, ll depth, vector<bool> use){
      |                                 ^
a.cc: In function 'void dfs(ll, ll, int)':
a.cc:29:9: error: 'color' was not declared in this scope
   29 |         color[vv] = c;
      |         ^~~~~
a.cc:30:9: error: 'use' was not declared in this scope
   30 |         use[vv] = true;
      |         ^~~
a.cc:32:21: error: 'es' was not declared in this scope
   32 |         for(ll to : es[vv]){
      |                     ^~
a.cc: In function 'int main()':
a.cc:43:17: error: 'es' was not declared in this scope
   43 |                 es[tmp1].push_back(tmp2);
      |                 ^~
a.cc:49:27: error: 'vector' was not declared in this scope
   49 |                 dfs(v, 0, vector<bool>(N+1, false));
      |                           ^~~~~~
a.cc:49:27: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/queue:63,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:49:34: error: expected primary-expression before 'bool'
   49 |                 dfs(v, 0, vector<bool>(N+1, false));
      |                                  ^~~~
a.cc:52:34: error: 'color' was not declared in this scope
   52 |                 printf("%lld\n", color[i+1]);
      |                                  ^~~~~