Language: C++

#include<bits/stdc++.h>
#define EPS (1e-10)
#define INF (double)(0x3f3f3f3f)
#define equals(a,b)(fabs((a)-(b))<EPS)
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<double, int>P;

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {}
	Point operator+(Point p) { return Point(x + p.x, y + p.y); }
	Point operator-(Point p) { return Point(x - p.x, y - p.y); }
	Point operator*(double a) { return Point(a*x, a*y); }
	Point operator/(double a) { return Point(x / a, y / a); }

	double norm() { return x*x + y*y; }
	double abs() { return sqrt(norm()); }

	bool operator<(const Point&p)const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator==(const Point&p)const {
		return fabs(x - p.x) < EPS&&fabs(y - p.y) < EPS;
	}
};
typedef Point Vector;
double norm(Vector a) {
	return a.x*a.x + a.y*a.y;
}
double abs(Vector a) {
	return sqrt(norm(a));
}
double getDistance(Point a, Point b) {
	return abs(a - b);
}
class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) :c(c), r(r) {}
};
double getDistance(Circle c1, Circle c2) {
	return max(0.0L, getDistance(c1.c, c2.c) - c1.r - c2.r);
}
double getDistance(Circle c, Point p) {
	return max(0.0L, getDistance(c.c, p) - c.r);
}
double dist[1200][1200];
double d[1200];
Circle c[1200];
int main() {
	double xs, ys, xt, yt; scanf("%lf%lf%lf%lf", &xs, &ys, &xt, &yt);
	int n; scanf("%d", &n);
	rep(i, n) {
		double x, y, r; scanf("%lf%lf%lf", &x, &y, &r);
		c[i] = { { x,y },r };
	}
	c[n] = { {xs,ys} };
	c[n + 1] = { {xt,yt} };
	n += 2;
	rep(i, n)for (int j = i + 1; j < n; j++) {
		dist[i][j] = dist[j][i] = getDistance(c[i], c[j]);
	}
	fill(d, d + n, INF);
	priority_queue<P, vector<P>, greater<P>>que;
	d[n - 2] = 0;
	que.push(P(0, n - 2));
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (p.first != d[p.second])continue;
		rep(j, n) {
			if (d[j] > p.first + dist[p.second][j]) {
				d[j] = p.first + dist[p.second][j];
				que.push(P(d[j], j));
			}
		}
	}
	printf("%.12lf\n", d[n - 1]);
}

Compiler output:
a.cc: In function 'double getDistance(Circle, Circle)':
a.cc:44:19: error: no matching function for call to 'max(long double, double)'
   44 |         return max(0.0L, getDistance(c1.c, c2.c) - c1.r - c2.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:44:19: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   44 |         return max(0.0L, getDistance(c1.c, c2.c) - c1.r - c2.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:44:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   44 |         return max(0.0L, getDistance(c1.c, c2.c) - c1.r - c2.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'double getDistance(Circle, Point)':
a.cc:47:19: error: no matching function for call to 'max(long double, double)'
   47 |         return max(0.0L, getDistance(c.c, p) - c.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:47:19: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
   47 |         return max(0.0L, getDistance(c.c, p) - c.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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
/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:47:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long double'
   47 |         return max(0.0L, getDistance(c.c, p) - c.r);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~