Language: C++

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
 
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl '\n'
#define x first
#define y second
#define int long long
#define double long double
#define pii pair<int, int>
#define pb push_back
#define vec vector
#define beg begin
#define dbg(x) cout << #x << " = " << x << endl;
 
template<class T> ostream& operator<<(ostream &str, vector<T> &a) {
    for (auto &i : a) {
        str << i << " ";
    }
    return str;
}
 
template<class T> istream& operator>>(istream &str, vector<T> &a) {
    for (auto &i : a) {
        str >> i;
    }
    return str;
}
 
template<class T> ostream& operator<<(ostream &str, pair<T, T> &a) {
    str << a.first << " " << a.second;
    return str;
}
 
template<class T> istream& operator>>(istream &str, pair<T, T> &a) {
    str >> a.first >> a.second;
    return str;
}
 
void solve(); signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    srand(time(0));
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout.setf(ios::fixed); cout.precision(20);
    solve();
    return 0;
}

const int MAXN = 1e5 + 10;
const double INF = 2e18 + 10;
int n;
vec<vec<int>> cycl;
int xs, ys, xf, yf;
vec<pair<double, int>> g[MAXN];

double get_dist(vec<int> &a, vec<int> &b) {
    int x1 = a[0], y1 = a[1], r1 = a[2];
    int x2 = b[0], y2 = b[1], r2 = b[2];
    if ((r1 + r2) * (r1 + r2) >= (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) {
        return (double)0.;
    }
    else {
        return max((double)0., sqrtl((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) - (double)(r1 + r2));
    }
}

void solve() {
    cin >> xs >> ys >> xf >> yf;
    cin >> n;
    cycl.resize(n, vec<int>(3));
    for (int i = 0; i < n; ++i) {
        cin >> cycl[i];
    }
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            double wt = get_dist(cycl[i], cycl[j]);
            g[i].pb({wt, j});
            g[j].pb({wt, i});
        }
    }
    for (int i = 0; i < n; ++i) {
        vec<int> tmp = {xs, ys, 0};
        double wt = get_dist(tmp, cycl[i]);
        g[n].pb({wt, i});
        g[i].pb({wt, n});
    }
    for (int i = 0; i < n; ++i) {
        vec<int> tmp = {xf, yf, 0};
        double wt = get_dist(tmp, cycl[i]);
        g[n + 1].pb({wt, i});
        g[i].pb({wt, n + 1});
    }

    vec<double> dist(MAXN, INF);
    dist[n] = (double)0.;
    priority_queue<pair<double, int>> se;
    se.push({(double)0., n});
    while (!se.empty()) {
        auto it = se.top();
        se.pop();
        if (dist[it.y] < it.x) continue;
        for (auto nxt : g[it.y]) {
            if (dist[nxt.y] > dist[it.y] + nxt.x) {
                dist[nxt.y] = dist[it.y] + nxt.x;
                se.emplace({-dist[nxt.y], nxt.y});
            }
        }
    }

    cout << dist[n + 1] << endl;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:111:27: error: no matching function for call to 'std::priority_queue<std::pair<long double, long long int> >::emplace(<brace-enclosed initializer list>)'
  111 |                 se.emplace({-dist[nxt.y], nxt.y});
      |                 ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
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:2:
/usr/include/c++/14/bits/stl_queue.h:752:9: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::emplace(_Args&& ...) [with _Args = {}; _Tp = std::pair<long double, long long int>; _Sequence = std::vector<std::pair<long double, long long int> >; _Compare = std::less<std::pair<long double, long long int> >]'
  752 |         emplace(_Args&&... __args)
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_queue.h:752:9: note:   candidate expects 0 arguments, 1 provided