Language: C++

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  LD xs,ys,xt,yt;
  cin >> xs >> ys >> xt >> yt;
  int n;
  cin >> n;
  vector<LD> x(n+2),y(n+2),r(n+2);
  x[0]=xs,y[0]=ys,r[0]=0;
  x[n+1]=xt,y[n+1]=yt,r[n+1]=0;
  for(int i=1;i<=n;i++){
    cin >> x[i] >> y[i] >> r[i];
  }
  vector<vector<LD>> e(n+2,vector<LD>(n+2));
  for(int i=0;i<=n+1;i++){
    for(int j=0;j<=n+1;j++){
      e[i][j]=max(0.0,sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j]);
    }
  }
  vector<LD> dist(n+2,LINF);
  priority_queue<pair<LD,int>,vector<pair<LD,int>>,function<bool(pair<LD,int>,pair<LD,int>)>>
    dijk([](const pair<LD,int> &a, const pair<LD,int> &b){return a>b;});
  dijk.push({0,0});
  pair<LD,int> now;
  while(!dijk.empty()){
    now=dijk.top();
    dijk.pop();
    if(dist[now.second]==LINF){
      dist[now.second]=now.first;
      if(now.second==n+1) break;
      for(int i=1;i<=n+1;i++){
        if(dist[i]==LINF){
          dijk.push({now.first+e[now.second][i],i});
        }
      }
    }
  }
  cout << fixed << setprecision(10) << dist[n+1] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: no matching function for call to 'max(double, long double)'
   31 |       e[i][j]=max(0.0,sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j]);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:18: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'long double')
   31 |       e[i][j]=max(0.0,sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j]);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:31:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   31 |       e[i][j]=max(0.0,sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j]);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~