Language: C++

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

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v;
	stringstream ss(s);
	string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}

#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }

void err(vector<string>::iterator it) {}

template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> inline T tabs(T a) { return (a > 0) ? a : -a; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

typedef pair<int, int> P;
const int N = 100001, C = 1000001, INF = (int) 1e9;
struct E {
	int to, fac;
};
int d[N];
vector<E> g[N];
unorederd_map<int, bool> colors[N];

struct State {
	int vertex, cost, color;
	State() {}
	State(int _v, int cs, int cl) : vertex(_v), cost(cs), color(cl) {}
};
struct Comp {
	bool operator() (const State &s1, const State &s2) const {
		return s1.cost > s2.cost;
	};
};

void dijkstra(int s, int t) {
    priority_queue<State, vector<State>, Comp> que;
    fill(d, d + N, INF);
    d[s] = 0;
    que.push(State(s, 0, -1));
    while (!que.empty()) {
        auto p = que.top(); que.pop();
        if (d[p.vertex] < p.cost) continue;
		if (p.cost - d[t] >= 1) return;
        REPU(i, 0, g[p.vertex].size()) {
            E e = g[p.vertex][i];
			int cost = 1;
			if (e.fac == p.color) cost = 0;
            if (d[e.to] > d[p.vertex] + cost) {
				colors[e.to].clear();
				colors[e.to][e.fac] = 1;
                d[e.to] = d[p.vertex] + cost;
                que.push(State(e.to, d[e.to], e.fac));
            }
			else if (d[e.to] == d[p.vertex] + cost) {
				if (colors[e.to].count(e.fac) == 0) {
					que.push(State(e.to, d[e.to], e.fac));
					colors[e.to][e.fac] = 1;
				}
			}
        }
    }
}

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	int n, m, p, q, c;

	cin >> n >> m;
	REPU(_, 0, m) {
		cin >> p >> q >> c;
		g[p].push_back((E) {q, c});
		g[q].push_back((E) {p, c});
	}

	dijkstra(1, n);
	if (d[n] == INF) d[n] = -1;
	cout << d[n] << endl;

	return 0;
}


Compiler output:
a.cc:46:1: error: 'unorederd_map' does not name a type
   46 | unorederd_map<int, bool> colors[N];
      | ^~~~~~~~~~~~~
a.cc: In function 'void dijkstra(int, int)':
a.cc:73:33: error: 'colors' was not declared in this scope
   73 |                                 colors[e.to].clear();
      |                                 ^~~~~~
a.cc:79:37: error: 'colors' was not declared in this scope
   79 |                                 if (colors[e.to].count(e.fac) == 0) {
      |                                     ^~~~~~