Language: C++

#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A&lang=ja"

#include<bits/stdc++.h>

using namespace std;

#include "../../datastructure/FibHeapMap.cpp"

namespace dijkstra_n {
template<class W>
struct Edge {
	using type = Edge<W>;
	int to;
	W w;
	template<class... Args> Edge(int t, Args... args) : to(t), w(args...) {}
	inline bool operator<(const Edge& rhs) const { return w < rhs.w; }
	inline bool operator>(const type& rhs) const { return rhs < *this; }
	inline bool operator>=(const type& rhs) const { return !(*this < rhs); }
	inline bool operator<=(const type& rhs) const { return !(rhs < *this); }
	inline bool operator==(const type& rhs) const { return !(*this < rhs) && !(rhs < *this); }
	inline bool operator!=(const type& rhs) const { return (*this < rhs) || (rhs < *this); }
};
template<class W>
struct Edges : private vector<vector<Edge<W>>> {
	using type = vector<vector<Edge<W>>>;
	template<class... Args> Edges(Args... args) : type(args...) {}
	template<class... Args> void add_edge(int u, int v, Args... args) {
		(*this)[u].emplace_back(v, args...);
	}
	using type::begin; using type::end; using type::rbegin; using type::rend;
	using type::cbegin; using type::cend; using type::crbegin; using type::crend;
	using type::size; using type::operator[]; using type::at; using type::back; using type::front;
	using type::reserve; using type::resize; using type::assign; using type::shrink_to_fit;
	using type::clear; using type::erase; using type::insert; using type::swap; 
	using type::push_back; using type::pop_back; using type::emplace_back; using type::empty;
};
template<class W>
struct Graph {
	const int sz;
	Edges<W> e;
	Graph(int n) : sz(n), e(sz) {}
	template<class... Args> void add_edge(int u, int v, Args... args) {
		e.add_edge(u, v, args...);
	}
	int size() {
		return sz;
	}
};
template<class W, class T = W>
struct Graph_D : public Graph<W> {
	vector<T> dist;
	Graph_D(int n) : Graph<W>(n), dist(n) {}
};
template<class W, class T>
void Dijkstra(Graph_D<W, T>& g, int start, T INF_COST) {
	auto& dist = g.dist;
	auto& e = g.e;
	for (auto& ww : dist) ww = INF_COST;
	using heap = FibHeapMap<T, int, greater<>>;
	heap q;
	vector<typename heap::np> node(g.size(), nullptr);
	q.push(0, start); dist[start] = 0;
	while (!q.empty()) {
		auto a = q.top(); q.pop();
		if (dist[a.second] < a.first) continue;
		for (auto& p : e[a.second]) {
			if (p.w == INF_COST) continue;
			W w = dist[a.second] + p.w;
			if (w < dist[p.to]) {
				dist[p.to] = w;
				if (!node[p.to]) node[p.to] = q.push(w, p.to);
				q.increase_key(node[p.to], w);
			}
		}
	}
}
}

using dijkstra_n::Dijkstra;
template<class T, class U = T> using graph = dijkstra_n::Graph_D<T, U>;
// int main() {
// 	int V, E, S;
// 	scanf("%d%d%d", &V, &E, &S);
// 	graph<int> D(V);
// 	for (int i = 0; i < E; i++) {
// 		int a, b, c;
// 		scanf("%d%d%d", &a, &b, &c);
// 		D.add_edge(a, b, c);
// 	}
// 	Dijkstra(D, S, INT_MAX);
// 	for (int i = 0; i < V; i++) {
// 		if (D.dist[i] == INT_MAX) cout << "INF" << endl;
// 		else cout << D.dist[i] << endl;
// 	}
// }

signed main()
{
	int N;
	vector<int> x, y, r;
	{
		int a, b, c, d;
		assert(scanf("%lld%lld%lld%lld", &a, &b, &c, &d) == 4);
		x.push_back(a);
		y.push_back(b);
		r.push_back(0);
		x.push_back(c);
		y.push_back(d);
		r.push_back(0);
	}
	assert(scanf("%lld", &N) == 1);
	for (int i = 0; i < N; i++) {
		int a, b, c;
		assert(scanf("%lld%lld%lld", &a, &b, &c) == 3);
		x.push_back(a);
		y.push_back(b);
		r.push_back(c);
	}
	graph<double> G(N+2);
	for (int i = 0; i < N+2; i++) {
		for (int j = 0; j < N+2; j++) {
			double dx = x[i] - x[j];
			double dy = y[i] - y[j];
			dx *= dx;
			dy *= dy;
			G.add_edge(i, j, max<double>(0, sqrt(dx + dy) - r[i] - r[j]));
		}
	}
	Dijkstra(G, 0, 1e18);
	cout << fixed << setprecision(12) << G.dist[1] << endl;
}


Compiler output:
a.cc:7:10: fatal error: ../../datastructure/FibHeapMap.cpp: No such file or directory
    7 | #include "../../datastructure/FibHeapMap.cpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.