Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
inline int ri() { int n; cin >> n; return n;}

//経路復元なしDijkstra法
template<class T> 
vector<T> dijkstra(int start, const vector<vector<pair<int,T>>>& Hen){
	T INF = numeric_limits<T>::max();
	int N = Hen.size();
	vector<T> dist(N, INF);
	dist[start] = 0;
	priority_queue<pair<T,int>, vector<pair<T,int>>, greater<pair<T,int>>> que;
	que.push(0, start);
	while(que.size()) {
		int ver = que.top().second;
		T cost = que.top().first; que.pop();
		if(cost != dist[ver])continue;
		for(auto i : Hen[ver]) {
			if(dist[i.first] > cost + i.second) {
				dist[i.first] = cost + i.second;
				que.push(dist[i.first], i.first);
			}
		}
	}
	return dist;
}


int main()
{
    vector<tuple<double, double, double>> pos;
    {
        double xa, ya, xb, yb; cin >> xa >> ya >> xb >> yb;
        pos.push_back({xa, ya, 0}), pos.push_back({xb, yb, 0});
    }
    int n; cin >> n;
 
    for(int i = 0; i < n; i++) {
        double x, y, r; cin >> x >> y >> r;
        pos.push_back({x, y, r});
    }
 
    vector<vector<pair<int,double>>> hen(n + 2);
    for(int i = 0; i < n + 2; i++) {
        for(int j = i + 1; j < n + 2; j++) {
            double xa, ya, ra, xb, yb, rb, dist;
            tie(xa, ya, ra) = pos[i], tie(xb, yb, rb) = pos[j];
            dist =  sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb)) - (ra + rb);
            dist = max(dist, 0.0);
            hen[i].push_back({j, dist});
            hen[j].push_back({i, dist});
        }
    }
 
    cout << fixed <<setprecision(12) << dijkstra(0,hen)[1] << '\n';
 
 
}

Compiler output:
a.cc: In instantiation of 'std::vector<_Tp> dijkstra(int, const std::vector<std::vector<std::pair<int, T> > >&) [with T = double]':
a.cc:57:49:   required from here
   57 |     cout << fixed <<setprecision(12) << dijkstra(0,hen)[1] << '\n';
      |                                         ~~~~~~~~^~~~~~~
a.cc:15:17: error: no matching function for call to 'std::priority_queue<std::pair<double, int>, std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >, std::greater<std::pair<double, int> > >::push(int, int&)'
   15 |         que.push(0, start);
      |         ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<double, int>; _Sequence = std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >; _Compare = std::greater<std::pair<double, int> >; value_type = std::pair<double, int>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<double, int>; _Sequence = std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >; _Compare = std::greater<std::pair<double, int> >; value_type = std::pair<double, int>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 2 provided
a.cc:23:41: error: no matching function for call to 'std::priority_queue<std::pair<double, int>, std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >, std::greater<std::pair<double, int> > >::push(__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&, int&)'
   23 |                                 que.push(dist[i.first], i.first);
      |                                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<double, int>; _Sequence = std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >; _Compare = std::greater<std::pair<double, int> >; value_type = std::pair<double, int>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<double, int>; _Sequence = std::vector<std::pair<double, int>, std::allocator<std::pair<double, int> > >; _Compare = std::greater<std::pair<double, int> >; value_type = std::pair<double, int>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 2 provided