criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
#include<queue>
#include<vector>
#include<cmath>
#include<iomanip>

using namespace std;

typedef pair<double, int> P;

struct Edge {
	int to;
	double cost;
	Edge(int a, double b) { to = a, cost = b; }
};

struct shelter {
	double x, y, r;
	shelter(double a, double b, double c) {
		x = a, y = b, r = c;
	}
	shelter() { x - 0, y = 0, r = 0; }
};

double getdis(shelter &A, shelter &B) {
	double dis = sqrt(pow(A.x - B.x, 2) + pow(A.y - B.y, 2)) - A.r - B.r;
	if (dis > 0) return dis;
	else return 0;
}

double sx, sy, tx, ty;
int N;
vector<shelter> S;
vector<vector<Edge>> E;

double dis[1002];

void djk(int s) {

	for (int i = 0; i < N + 2; i++)dis[i] = 10000000000;

	priority_queue<P, vector<P>, greater<P>> pq;
	pq.push(P(0, s));
	dis[s] = 0.0;
	
	while (pq.size()) {
		P now = pq.top(); pq.pop();
		int pos = now.second;
		double totalcost = now.first;
		if (totalcost > dis[pos])continue;

		for (int i = 0; i < E[pos].size(); i++) {
			int nxt = E[pos][i].to;
			double cost = E[pos][i].cost;
			if (dis[nxt] > dis[pos] + cost) {
				dis[nxt] = dis[pos] + cost;
				pq.push(P(dis[nxt], nxt));
			}
		}
	}
}

int main() {
	cin >> sx >> sy >> tx >> ty;
	cin >> N;
	S.resize(N);
	for (int i = 0; i < N; i++) {
		cin >> S[i].x >> S[i].y >> S[i].r;
	}

	E.resize(N + 2);
	for (int i = 0; i < N; i++) {
		E[0].push_back(Edge(i + 1, getdis(shelter(sx, sy, 0), S[i])));//どうせ最初のスタートに戻らないので一方通行の辺でもいい
		E[i + 1].push_back(Edge(N + 1, getdis(shelter(tx, ty, 0), S[i])));//上と同じ理由でゴールも一方通行
	}
	
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i == j)continue;
			E[i + 1].push_back(Edge(j + 1, getdis(S[i], S[j])));
			E[j + 1].push_back(Edge(i + 1, getdis(S[j], S[i])));
		}
	}

	djk(0);

	cout << setprecision(12) << dis[N + 1] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:51: error: cannot bind non-const lvalue reference of type 'shelter&' to an rvalue of type 'shelter'
   75 |                 E[0].push_back(Edge(i + 1, getdis(shelter(sx, sy, 0), S[i])));//どうせ最初のスタートに戻らないので一方通行の辺でもいい
      |                                                   ^~~~~~~~~~~~~~~~~~
a.cc:27:24: note:   initializing argument 1 of 'double getdis(shelter&, shelter&)'
   27 | double getdis(shelter &A, shelter &B) {
      |               ~~~~~~~~~^
a.cc:76:55: error: cannot bind non-const lvalue reference of type 'shelter&' to an rvalue of type 'shelter'
   76 |                 E[i + 1].push_back(Edge(N + 1, getdis(shelter(tx, ty, 0), S[i])));//上と同じ理由でゴールも一方通行
      |                                                       ^~~~~~~~~~~~~~~~~~
a.cc:27:24: note:   initializing argument 1 of 'double getdis(shelter&, shelter&)'
   27 | double getdis(shelter &A, shelter &B) {
      |               ~~~~~~~~~^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)

struct edge{
    int to;
    double cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<double, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[1'010];//頂点iから出る辺の配列G[i]の配列。
double dist[1'010];//特定の頂点から各頂点への距離が格納される。
bool used[1'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        double d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    double xs,ys,xt,yt;
    cin>>xs>>ys>>xt>>yt;
    int n;
    cin>>n;
    double x[n+2],y[n+2],r[n+2];
    x[0] = xs;
    y[0] = ys;
    r[0] = 0.0;
    REPP(i,n){
      cin>>x[i]>>y[i]>>r[i];
    }
    x[n+1] = xt;
    y[n+1] = yt;
    r[n+1] = 0;
    double temp;
    REP(i,n+2){
      REP(j,n+2){
        if(i==j)continue;
        temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
        temp = max(temp, 0.0);
        G[i].push_back(edge{j, temp});
      }
    }
    dijkstra(0);
    double ans;
    ans = dist[n+1];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:22: error: 'setprecision' was not declared in this scope
   72 |     cout << fixed << setprecision(10) << ans << endl;
      |                      ^~~~~~~~~~~~
a.cc:5:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    4 | #include <cmath>
  +++ |+#include <iomanip>
    5 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)

struct edge{
    int to;
    double cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<double, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[1'010];//頂点iから出る辺の配列G[i]の配列。
double dist[1'010];//特定の頂点から各頂点への距離が格納される。
bool used[1'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        double d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    double xs,ys,xt,yt;
    cin>>xs>>ys>>xt>>yt;
    int n;
    cin>>n;
    double x[n+2],y[n+2],r[n+2];
    x[0] = xs;
    y[0] = ys;
    r[0] = 0.0;
    REPP(i,n){
      cin>>x[i]>>y[i]>>r[i];
    }
    x[n+1] = xt;
    y[n+1] = yt;
    r[n+1] = 0;
    double temp;
    REP(i,n+2){
      REP(j,n+2){
        if(i==j)continue;
        temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
        temp = max(temp, 0.0);
        G[i].push_back(edge{j, temp});
      }
    }
    dijkstra(0);
    double ans;
    ans = dist[n+1];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:16: error: 'hypot' was not declared in this scope
   63 |         temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
      |                ^~~~~
a.cc:71:22: error: 'setprecision' was not declared in this scope
   71 |     cout << fixed << setprecision(10) << ans << endl;
      |                      ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <queue>
  +++ |+#include <iomanip>
    4 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)

struct edge{
    int to;
    double cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<double, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[1'010];//頂点iから出る辺の配列G[i]の配列。
double dist[1'010];//特定の頂点から各頂点への距離が格納される。
bool used[1'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        double d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    double xs,ys,xt,yt;
    cin>>xs>>ys>>xt>>yt;
    int n;
    cin>>n;
    double x[n+2],y[n+2],r[n+2];
    x[0] = xs;
    y[0] = ys;
    r[0] = 0.0;
    REPP(i,n){
      cin>>x[i]>>y[i]>>r[i];
    }
    x[n+1] = xt;
    y[n+1] = yt;
    r[n+1] = 0;
    double temp;
    REP(i,n+2){
      REP(j,n+2){
        if(i==j)continue;
        temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
        temp = max(temp, 0.0);
        G[i].push_back(edge{j, temp});
      }
    }
    dijkstra(0);
    double ans;
    ans = dist[n+1];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: 'i' was not declared in this scope
   52 |     REPP(i,n){
      |          ^
a.cc:52:5: error: 'REPP' was not declared in this scope; did you mean 'REP'?
   52 |     REPP(i,n){
      |     ^~~~
      |     REP
a.cc:62:16: error: 'hypot' was not declared in this scope
   62 |         temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
      |                ^~~~~
a.cc:70:22: error: 'setprecision' was not declared in this scope
   70 |     cout << fixed << setprecision(10) << ans << endl;
      |                      ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <queue>
  +++ |+#include <iomanip>
    4 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#define REP(i,n) for(int i=0;i<n;i++)

struct edge{
    int to;
    double cost;
};

using namespace std;

//ダイクストラで多用する型
typedef pair<double, int> P;//(その頂点までの距離,頂点)として使う。

vector<edge> G[1'010];//頂点iから出る辺の配列G[i]の配列。
double dist[1'010];//特定の頂点から各頂点への距離が格納される。
bool used[1'010];//dijkstra実行中に、頂点iまでの距離を確定したかどうかを持つ。

void dijkstra(int v){//vは始点。
    //以下のリンクでpriority_queueの使い方を参照
    //http://shirokurostone.hatenablog.com/entry/20110522/1306052844
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, v));
    while(!que.empty()){
        P top = que.top();
        que.pop();
        int u = top.second;
        double d = top.first;
        //cout << u << ' ' << d << endl;
        if(used[u]) continue;
        dist[u] = d;
        used[u] = true;
        for(int i = 0; i < G[u].size(); i++){
            if(!used[G[u][i].to]){
                que.push(P(d+G[u][i].cost, G[u][i].to));
                //cout << G[u][i].to << ' ' <<  d+G[u][i].cost << endl;
            }
        }
    }
}

int main(){
    double xs,ys,xt,yt;
    cin>>xs>>ys>>xt>>yt;
    int n;
    cin>>n;
    double x[n+2],y[n+2],r[n+2];
    x[0] = xs;
    y[0] = ys;
    r[0] = 0.0;
    REPP(i,n){
      cin>>x[i]>>y[i]>>r[i];
    }
    x[n+1] = xt;
    y[n+1] = yt;
    r[n+1] = 0;
    double temp;
    REP(i,n+2){
      REP(j,n+2){
        if(i==j)continue;
        temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
        temp = max(temp, 0.0);
        G[i].push_back(edge{temp, j});
      }
    }
    dijkstra(0);
    double ans;
    ans = dist[n+1];
    cout << fixed << setprecision(10) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:10: error: 'i' was not declared in this scope
   52 |     REPP(i,n){
      |          ^
a.cc:52:5: error: 'REPP' was not declared in this scope; did you mean 'REP'?
   52 |     REPP(i,n){
      |     ^~~~
      |     REP
a.cc:62:16: error: 'hypot' was not declared in this scope
   62 |         temp = hypot(x[j]-x[i], y[j]-y[i]) - r[i] - r[j];
      |                ^~~~~
a.cc:64:29: warning: narrowing conversion of 'temp' from 'double' to 'int' [-Wnarrowing]
   64 |         G[i].push_back(edge{temp, j});
      |                             ^~~~
a.cc:64:35: warning: narrowing conversion of 'j' from 'int' to 'double' [-Wnarrowing]
   64 |         G[i].push_back(edge{temp, j});
      |                                   ^
a.cc:70:22: error: 'setprecision' was not declared in this scope
   70 |     cout << fixed << setprecision(10) << ans << endl;
      |                      ^~~~~~~~~~~~
a.cc:4:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    3 | #include <queue>
  +++ |+#include <iomanip>
    4 | #define REP(i,n) for(int i=0;i<n;i++)
Language: C

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

double kr(double a, double b, double c, double d) {
    return sqrt((a-c)*(a-c) + (b-d)*(b-d));
}

#define P pair<double,int>

int n;
bool visited[1002];
double x[1002],y[1002],r[1002];
vector<P> v[1002];
priority_queue<P,vector<P>,greater<P>> pq;

signed main() {
    cin >> x[0] >> y[0] >> x[1] >> y[1] >> n;n+=2;
    repo(i,2,n) cin >> x[i] >> y[i] >> r[i];
    rep(i,n) repo(j,i+1,n) {
        double hoge = max(0.0,kr(x[i],y[i],x[j],y[j])-r[i]-r[j]);
        v[i].pb(mp(hoge,j));
        v[j].pb(mp(hoge,i));
    }
    visited[0] = true;
    rep(i,v[0].size()) pq.push(v[0][i]);
    while(!pq.empty()) {
        int k = pq.top().se;
        double a = pq.top().fi;
        pq.pop();
        if (visited[k]) continue;
        if (k == 1) {
            cout << setprecision(20) << a << endl;
            return 0;
        }
        visited[k] = true;
        rep(i,v[k].size()) pq.push(mp(v[k][i].fi + a,v[k][i].se));
    }

}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#define LOCAL

#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>

using namespace std;

// From Errichto's Youtube stream
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using int64 = long long;

/////////////////////
// Code starts here//
/////////////////////
const double INF = 1e12;

struct Circle {
    int x, y, r;
};

vector<Circle> circles;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int xa, ya, xb, yb, xc, yc, r;
    int N;
    cin >> xa >> ya >> xb >> yb;
    
    cin >> N;

    circles.push_back(Circle{xa, ya, 0});
    for (int i = 0; i < N; i++) {
        cin >> xc >> yc >> r;
        circles.push_back(Circle{xc, yc, r});
    }
    circles.push_back(Circle{xb, yb, 0});

    N += 2;

    vector<double> dist(N, INF);
    vector<char> seen(N);

    dist[0] = 0;

    for (int steps = 0; steps < N; steps++) {
        auto el = min_element(dist.begin(), dist.end()) - dist.begin();
        auto d = dist[el];

        seen[el] = true;
        dist[el] = INF;
        //debug() << el << " " << d;

        if (el == N - 1) {
            cout << setprecision(10) << d << "\n";
            return 0;
        }

        for (int i = 0; i < N; i++) {
            if (!seen[i]) {
                auto cost = hypot(1.0 * circles[i].x - circles[el].x, 1.0 * circles[i].y - circles[el].y);
                double common = circles[i].r + circles[el].r;
                if (cost >= common) {
                    cost = abs(cost - common);
                } else {
                    cost = 0;
                }

                if (dist[i] > d + cost) {
                    dist[i] = d + cost;
                }
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:104:29: error: 'hypot' was not declared in this scope
  104 |                 auto cost = hypot(1.0 * circles[i].x - circles[el].x, 1.0 * circles[i].y - circles[el].y);
      |                             ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, double> lpair;
typedef pair<double, ll> lpair2;
const ll MOD = 1e9 + 7;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define INF (1e18)

int main(){   
    cin.tie(0);
    ios::sync_with_stdio(false);
    double xs, ys, xt, yt;
    ll N;
    double x[1010], y[1010], r[1010];
    cin >> xs >> ys >> xt >> yt;
    cin >> N;
    rep(i,1,N+1) cin >> x[i] >> y[i] >> r[i];
    x[0] = xs; y[0] = ys, r[0] = 0;
    x[N+1] = xt; y[N+1] = yt; r[N+1] = 0;
    vector<lpair> tree[1010];
    rep(i,0,N+2){
        rep(j,0,N+2){
            if(i == j) continue;
            double dist = sqrt(pow(x[i] - x[j],2) + pow(y[i] - y[j], 2));
            double hankei = r[i] + r[j];
            dist = max(0.0, dist - hankei);
            tree[i].push_back(make_pair(j, dist));
        }
    }

    priority_queue<lpair2, vector<lpair2> ,greater<lpair2> > pq;
    double dist[1010] = {};
    rep(i,1,N+2) dist[i] = INF;
    rep(i,0,N+2) pq.push(make_pair(dist[i], i));
    ll is_visit[1010] = {};
    while(!pq.empty()){
        lpair2 l1 = pq.top();
        pq.pop();
        is_visit[l1.second] = 1;
        for(auto &e: tree[l1.second]){
            if(dist[e.first] > dist[l1.second] + e.second){
                if(!is_visit[e.first]){
                    dist[e.first] = dist[l1.second] + e.second;
                    pq.push(make_pair(dist[e.first], e.first));
                }
            }
        }
    }
    // printa(dist, N+2);
    cout << setprecision(12) << dist[N+1] << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:55:51: error: expected '}' at end of input
   55 |     cout << setprecision(12) << dist[N+1] << endl;
      |                                                   ^
a.cc:14:11: note: to match this '{'
   14 | int main(){
      |           ^
Language: C


//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>


#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define swap(p,q) r=(p);(p)=(q);(q)=r
#define INF 1000000000000//10^12
#define INFINT 2000000001//2*10^9+1

using namespace std;

struct edge{
	int to;
	double cost;
};

typedef pair<int, int> P;

int V;//辺の本数
static vector<edge> G[1000010];//辺の情報　手で埋めておく必要あり
double d[1010];
ll int n,xs,ys,xt,yt;

void init(double dd[], int num){
	int i;
	for(i=0;i<num;i++){
		dd[i]=INFINT;
	}
}

void dijkstra(int s){

	priority_queue<P, vector<P>, greater<P> > que;
	init(d,1010);
//	printf("d[1]=%lf\n",d[1]);
	d[s]=0;
	que.push(P(0,s));

	while(!que.empty()){
		P p=que.top();
		que.pop();
		int v=p.second;
		if(d[v]<p.first) continue;
		for(int i=0; i<G[v].size(); i++){
			edge e=G[v][i];
//			printf("d[0]=%lf,d[1]=%lf,d[2]=%lf",d[0],d[1],d[2]);
			if(d[e.to]>d[v]+e.cost){
				d[e.to]=d[v]+e.cost;
				que.push(P(d[e.to],e.to));
			}
		}
	}

}

int main(void)
{
	//変数の宣言
//	int n,xs,ys,xt,yt;
	static ll int x[100010];
	static ll int y[100010];
	static int r[100010];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	int ans=0;
	int count=0;
	double temp,temp1,temp2;
	int max,min;
	int len;
	int sum=0;



	//データの読み込み


	scanf("%lld %lld %lld %lld\n%lld",&xs,&ys,&xt,&yt,&n);
//	scanf_s("%lld %lld %lld %lld\n%lld",&xs,&ys,&xt,&yt,&n);

	for(i=1;i<=n;i++){
		scanf("%lld %lld %d",&x[i],&y[i],&r[i]);
//		scanf_s("%lld %lld %d",&x[i],&y[i],&r[i]);
	}
	
	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理
	
	x[0]=xs;
	y[0]=ys;
	r[0]=0;
	x[n+1]=xt;
	y[n+1]=yt;
	r[n+1]=0;
	for(i=0;i<=n;i++){
		for(j=i+1;j<=n+1;j++){
			temp=max(0,sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j]);
			edge p;
			p.to=j;
			p.cost=temp;
			G[i].push_back(p);
			p.to=i;
			G[j].push_back(p);
		}
	}

	dijkstra(0);

	
	//	printf("計算部分終了\n");

	//出力

	printf("%1.10lf",d[n+1]);

	//	printf("結果の出力終了\n");


	return 0;
}



Compiler output:
main.c:8:10: fatal error: vector: No such file or directory
    8 | #include <vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<iomanip>
#include<cmath>
#include<climits>
#include<queue>
using namespace std;
#define SQ(x) ((x)*(x))

struct B { 
	long long x,y,r; 
	double dist(B b) {
		long long sqd = SQ(b.x - x) + SQ(b.y - y);
		if (sqd <= SQ(b.r + r)) return 0;
		return sqrt(sqd) - b.r - r;
	}
};
typedef pair<double, int> P;//cost, to

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	long long xs, ys, xt, yt, n;
	cin >> xs >> ys >> xt >> yt >> n;
	vector<B> bar(n + 2);
	bar[0] = { xs,ys,0 };
	bar[n+1] = { xt,yt,0 };
	long long xi, yi, ri;
	for (int i = 1; i <= n; ++i) {
		cin >> xi >> yi >> ri;
		bar[i] = { xi,yi,ri };
	}

	vector<vector<double>> g(n + 2,vector<double>(n+2));
	for (int i = 0; i < n + 2; ++i) {
		for (int j = i + 1; j < n + 2; ++j) {
			double d = bar[i].dist(bar[j]);
			g[i][j] = d;
			g[j][i] = d;
		}
	}

	vector<double> d(n+2, DBL_MAX);
	priority_queue<P> que;
	d[0]=0;que.push({0,0});
	while(que.size())
	{
		P p = que.top();que.pop();
		double dist1 = d[p.second];
		if (dist1 < -p.first) continue;
		for (int i = 0; i < n + 2; ++i) {
			if (i == p.second) continue;
			double dist2 = g[p.second][i];
			if (d[i] > dist1 + dist2) {
				d[i] = dist1 + dist2;
				que.push({ -d[i],i });
			}
		}
	}
	cout<<fixed<<setprecision(15)<<d[n+1]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:31: error: 'DBL_MAX' was not declared in this scope
   43 |         vector<double> d(n+2, DBL_MAX);
      |                               ^~~~~~~
a.cc:6:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    5 | #include<queue>
  +++ |+#include <cfloat>
    6 | using namespace std;
Language: C++

#include<iostream>
#include<iomanip>
#include<cmath>
#include<queue>
using namespace std;
#define SQ(x) ((x)*(x))

struct B { 
	long long x,y,r; 
	double dist(B b) {
		long long sqd = SQ(b.x - x) + SQ(b.y - y);
		if (sqd <= SQ(b.r + r)) return 0;
		return sqrt(sqd) - b.r - r;
	}
};
typedef pair<double, int> P;//cost, to

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	long long xs, ys, xt, yt, n;
	cin >> xs >> ys >> xt >> yt >> n;
	vector<B> bar(n + 2);
	bar[0] = { xs,ys,0 };
	bar[n+1] = { xt,yt,0 };
	long long xi, yi, ri;
	for (int i = 1; i <= n; ++i) {
		cin >> xi >> yi >> ri;
		bar[i] = { xi,yi,ri };
	}

	vector<vector<double>> g(n + 2,vector<double>(n+2));
	for (int i = 0; i < n + 2; ++i) {
		for (int j = i + 1; j < n + 2; ++j) {
			double d = bar[i].dist(bar[j]);
			g[i][j] = d;
			g[j][i] = d;
		}
	}

	vector<double> d(n+2, DBL_MAX);
	priority_queue<P> que;
	d[0]=0;que.push({0,0});
	while(que.size())
	{
		P p = que.top();que.pop();
		double dist1 = d[p.second];
		if (dist1 < -p.first) continue;
		for (int i = 0; i < n + 2; ++i) {
			if (i == p.second) continue;
			double dist2 = g[p.second][i];
			if (d[i] > dist1 + dist2) {
				d[i] = dist1 + dist2;
				que.push({ -d[i],i });
			}
		}
	}
	cout<<fixed<<setprecision(15)<<d[n+1]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:31: error: 'DBL_MAX' was not declared in this scope
   42 |         vector<double> d(n+2, DBL_MAX);
      |                               ^~~~~~~
a.cc:5:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
    4 | #include<queue>
  +++ |+#include <cfloat>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<queue>
using namespace std;
#define SQ(x) ((x)*(x))

struct B { 
	long long x,y,r; 
	double dist(B b) {
		long long sqd = SQ(b.x - x) + SQ(b.y - y);
		if (sqd <= SQ(b.r + r)) return 0;
		return sqrt(sqd) - b.r - r;
	}
};
typedef pair<double, int> P;//cost, to

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	long long xs, ys, xt, yt, n;
	cin >> xs >> ys >> xt >> yt >> n;
	vector<B> bar(n + 2);
	bar[0] = { xs,ys,0 };
	bar[n+1] = { xt,yt,0 };
	long long xi, yi, ri;
	for (int i = 1; i <= n; ++i) {
		cin >> xi >> yi >> ri;
		bar[i] = { xi,yi,ri };
	}

	vector<vector<double>> g(n + 2,vector<double>(n+2));
	for (int i = 0; i < n + 2; ++i) {
		for (int j = i + 1; j < n + 2; ++j) {
			double d = bar[i].dist(bar[j]);
			g[i][j] = d;
			g[j][i] = d;
		}
	}

	vector<double> d(n+2, INT32_MAX);
	priority_queue<P> que;
	d[0]=0;que.push({0,0});
	while(que.size())
	{
		P p = que.top();que.pop();
		double dist1 = d[p.second];
		if (dist1 < -p.first) continue;
		for (int i = 0; i < n + 2; ++i) {
			if (i == p.second) continue;
			double dist2 = g[p.second][i];
			if (d[i] > dist1 + dist2) {
				d[i] = dist1 + dist2;
				que.push({ -d[i],i });
			}
		}
	}
	cout<<d[n+1]<<endl;
	return 0;
}

Compiler output:
a.cc: In member function 'double B::dist(B)':
a.cc:11:24: error: 'sqrt' was not declared in this scope
   11 |                 return sqrt(sqd) - b.r - r;
      |                        ^~~~
a.cc: In function 'int main()':
a.cc:40:31: error: 'INT32_MAX' was not declared in this scope
   40 |         vector<double> d(n+2, INT32_MAX);
      |                               ^~~~~~~~~
a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include<queue>
  +++ |+#include <cstdint>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<queue>
#include<bitset>
#include<algorithm>
#include<climits>
#include<vector>
#include<deque>
#include<cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define fill(x,y) memset(x,y,sizeof(x))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define dump(a) rep(i,a.size()){ cout<<a[i]<<" "; } cout<<endl;
#define dumparr(a,n) rep(i,n){ cout<<a[i]<<" "; } cout<<endl;
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define INF INT_MAX/3
#define EPS 1e-7

/* 基本的にダイクストラ
 * nodeをバリアの中心点、edgeを全点間に張って、その長さを(中心同士の距離-半径二つ)とする
 */

int main(){
  ll xs,ys, xt,yt;
  ll n;
  ll x[1003], y[1003], r[1003];
  cin>>xs>>ys>>xt>>yt>>n;
  rep(i,n){
    cin>>x[i]>>y[i]>>r[i];
  }
  // x[0]~x[n-1]は点, x[n]がstart, x[n+1]がend
  x[n]=xs; y[n]=ys; r[n]=0;
  x[n+1]=xt; y[n+1]=yt; r[n+1]=0;

  // ダイクストラ
  double d[1003]; // sからの最小距離
  bool used[1003];
  rep(i,n+2) d[i]=INF;
  fill(used, false);
  d[n] = 0;
  while(true) {
    /* dumparr(used, n+2); */
    /* dumparr(d,n+2); */
    ll v = -1; // 残ってるうちで最短のもの
    rep(i,n+2){
      if(!used[i] && (v == -1 || d[i] < d[v])) v = i;
    }
    /* dbg(v); */
    if(v==-1) break; // 終わり
    used[v] = true;
    rep(u,n+2) { 
      /* dbg(sqrt((x[u]-x[v])*(x[u]-x[v])+(y[u]-y[v])*(y[u]-y[v]))); */
      double dist = mmax(0, sqrt((x[u]-x[v])*(x[u]-x[v])+(y[u]-y[v])*(y[u]-y[v]))-r[u]-r[v]);
      d[u] = mmin( d[u], d[v]+dist );
    }
  }
  /* dumparr(d, n+2); */
  cout<<d[n+1]<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'memset' was not declared in this scope
   15 | #define fill(x,y) memset(x,y,sizeof(x))
      |                   ^~~~~~
a.cc:45:3: note: in expansion of macro 'fill'
   45 |   fill(used, false);
      |   ^~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<cmath>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include<queue>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

void Read(int &p)
{
	p=0;
	int f=1;
	char c=getchar();
	while(c<'0' || c>'9')
	{
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0' && c<='9')
		p=p*10+c-'0',c=getchar();
	p*=f;
}

const int MAXN=1000+24;
int N,x[MAXN],y[MAXN],r[MAXN],vis[MAXN];
double Dis[MAXN];
#define ids(i,j) max(0.0,sqrt(1.0*(x[i]-x[j])*(x[i]-x[j])+1.0*(y[i]-y[j])*(y[i]-y[j]))-r[i]-r[j])

bool inq[MAXN];
int showup[MAXN];
int Spfa()
{
	int s=1,t=2;
    queue<int>Q;
    for(int i=1;i<=N;i++) Dis[i]=(i==s)?0:INF;
    Q.push(s),inq[s]=1,showup[s]++;

    int v,p,m,sz;

    while(!Q.empty())
    {
        p=Q.front(),Q.pop(),inq[p]=0,
        for(int i=1;i<=N;i++)
            if(Dis[i]>ids(p,o)+Dis[t])
            {
                Dis[i]=v+Dis[t];
                if(!inq[i])
                {
                    Q.push(i),inq[i]=1,showup[i]++;
                    if(showup[i]>N) return -1;
                }
            }
    }
    if(Dis[t]==INF) return -2;
    return Dis[t];
}
int main()
{
	Read(x[1]); Read(y[1]); Read(x[2]); Read(y[2]);
	Read(N),N+=2;
	for(int i=3;i<=N;i++)
		Read(x[i]),Read(y[i]),Read(r[i]);
	Dijkstra();
	printf("%.10lf",dis[2]);
}

Compiler output:
a.cc: In function 'int Spfa()':
a.cc:34:43: error: 'INF' was not declared in this scope
   34 |     for(int i=1;i<=N;i++) Dis[i]=(i==s)?0:INF;
      |                                           ^~~
a.cc:42:9: error: expected primary-expression before 'for'
   42 |         for(int i=1;i<=N;i++)
      |         ^~~
a.cc:42:21: error: 'i' was not declared in this scope
   42 |         for(int i=1;i<=N;i++)
      |                     ^
a.cc:53:16: error: 'INF' was not declared in this scope
   53 |     if(Dis[t]==INF) return -2;
      |                ^~~
a.cc: In function 'int main()':
a.cc:62:9: error: 'Dijkstra' was not declared in this scope
   62 |         Dijkstra();
      |         ^~~~~~~~
a.cc:63:25: error: 'dis' was not declared in this scope; did you mean 'Dis'?
   63 |         printf("%.10lf",dis[2]);
      |                         ^~~
      |                         Dis
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
using namespace std;

const int MAXN = 1000 + 10;

struct barrier
{
    int x, y, r;
};

int N;
int x1, x2, y1, y2;
vector <barrier> vbar;
double dist[MAXN];
bool inQueue[MAXN];

double getDist(int from, int to)
{
    double deltaX = vbar[from].x - vbar[to].x;
    double deltaY = vbar[from].y - vbar[to].y;
    return max(sqrt(deltaX * deltaX + deltaY * deltaY) - vbar[from].r - vbar[to].r, 0.0);
}

void SPFA()
{
    fill(dist, dist + N + 2, 0x7FFFFFFF);
    memset(inQueue, 0x00, sizeof inQueue);

    queue <int> q;
    q.push(0);
    dist[0] = 0, inQueue[0] = true;

    while(!q.empty())
    {
        int to = q.front();
        inQueue[to] = false;
        q.pop();

        for(int i = 0; i <= N + 1; i++)
        {
            if(i == to)
                continue;

            if(dist[i] > dist[to] + getDist(i, to))
            {
                dist[i] = dist[to] + getDist(i, to);
                if(!inQueue[i])
                {
                    inQueue[i] = true;
                    q.push(i);
                }
            }
        }
    }
}

int main()
{
    int u, v, w;

    cin >> x1 >> y1 >> x2 >> y2 ;
    vbar.push_back(barrier{x1, y1, 0});
    vbar.push_back(barrier{x2, y2, 0});

    cin >> N ;
    for(int i = 1; i <= N; i++)
        cin >> u >> v >> w, vbar.push_back(barrier{u, v, w});

    SPFA();

    cout << fixed << setprecision(10) << dist[1] << endl ;

    return 0;
}


Compiler output:
a.cc:18:13: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   18 | int x1, x2, y1, y2;
      |             ^~
a.cc: In function 'double getDist(int, int)':
a.cc:27:16: error: 'sqrt' was not declared in this scope
   27 |     return max(sqrt(deltaX * deltaX + deltaY * deltaY) - vbar[from].r - vbar[to].r, 0.0);
      |                ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#define REP(x,y) for(int i=x;i<=y;i++)
using namespace std;

struct point {
	double x; double y;
};
double INF = 100000000000000000;
int const MAX = 1005;
point a[MAX];
double radius[MAX];
double g[MAX][MAX];
int color[MAX];
double dist[MAX];

int main() {
	cin >> a[0].x >> a[0].y >> a[1].x >> a[1].y;
	radius[1] = radius[0] = 0;
	int n;
	cin >> n;
	REP(2, n + 1) {
		cin >> a[i].x >> a[i].y;
		cin >> radius[i];
	}
	REP(0, n + 1) {
		for (int j = 0; j <= i; j++) {
			double dist_x, dist_y;
			dist_x = a[i].x - a[j].x;
			dist_y = a[i].y - a[j].y;
			g[i][j] = g[j][i] = max(double(0),sqrt(dist_x*dist_x + dist_y * dist_y)-radius[i]-radius[j]);
		}
	}
	double ans = 0;
	int now = 0;
	REP(0, n + 1) color[i] = 0;
	REP(0, n + 1) dist[i] = INF;
	color[0] = 1;
	while (now != 1) {
		int nearest = 1;
		double nearest_dist = INF;
		REP(1, n + 1) {
			if (color[i] == 0) {
				dist[i] = min(dist[i], g[i][now]);
				if (nearest_dist >= dist[i]) {
					nearest_dist = dist[i];
					nearest = i;
				}
			}
		}
		now = nearest;
		color[now] = 1;
		ans += nearest_dist;
	}
	cout.precision(20);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:59: error: 'sqrt' was not declared in this scope
   32 |                         g[i][j] = g[j][i] = max(double(0),sqrt(dist_x*dist_x + dist_y * dist_y)-radius[i]-radius[j]);
      |                                                           ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<D,int> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
vector<P>g[1005];
int n;
D xs,ys,xt,yt;
D x[1005],y[1005],r[1005],d[1005];
int main(void){
    cin>>xs>>ys>>xt>>yt>>n;
    for(int i=1;i<=n;i++){
        cin>>x[i]>>y[i]>>r[i];
        g[0].PB(P(max(D(0),sqrt((xs-x[i])*(xs-x[i])+(ys-y[i])*(ys-y[i]))-r[i]),i));
        g[i].PB(P(max(D(0),sqrt((xt-x[i])*(xt-x[i])+(yt-y[i])*(yt-y[i]))-r[i]),n+1));
    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            g[i].PB(P(max(D(0),sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]))-r[i]-r[j]),j));
            g[j].PB(P(max(D(0),sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]))-r[i]-r[j]),i));
        }
    }
    for(int i=1;i<=n+1;i++)d[i]=10000000000;
    priority_queue<P,vector<P>,greater<P> >dik;
    dik.push(P(0,0));
    while(!dik.empty()){
        int v=dik.top().S;
        D c=dik.top().F;
        dik.pop();
        if(c>d[v])continue;
        for(int i=0;i<g[v].size();i++){
            int u=g[v][i].S;
            D l=g[v][i].F;
            if(d[u]>c+l){
                d[u]=c+l;
                dik.push(P(c+l,u));
            }
        }
    }
    printf("%.10lf\n",d[n+1]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:28: error: 'sqrt' was not declared in this scope
   26 |         g[0].PB(P(max(D(0),sqrt((xs-x[i])*(xs-x[i])+(ys-y[i])*(ys-y[i]))-r[i]),i));
      |                            ^~~~
a.cc:31:32: error: 'sqrt' was not declared in this scope
   31 |             g[i].PB(P(max(D(0),sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i]))-r[i]-r[j]),j));
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<lint, lint>;

class Dijkstra
{
    int V;
    double inf;
    vector<double> distance;
    double eps;
public:
    vector<vector<double> > e;
    Dijkstra(int V, double inf) : V(V), inf(inf), eps(1E-5)
    {
        e = vector<vector<double> >(V, vector<double>(V, inf));
        for (int i=0; i<V; i++) e[i][i] = 0;
    }
    void update_edge(int v1, int v2, double d)
    {
        e[v1][v2] = e[v2][v1] = min(e[v1][v2], d);
    }

    double dijkstra(int from, int to)
    {
        distance = vector<double>(V, inf);
        using Pque = pair<double, int>;
        priority_queue<Pque, vector<Pque>, greater<Pque> > que;
        que.push(make_pair(0.0, from));
        while (true)
        {
            int now = que.top().second;
            double dist_tmp = que.top().first;
            if (now == to) return dist_tmp;
            que.pop();

            if (distance[now] > dist_tmp + eps)
            {
                distance[now] = dist_tmp;
                for (int i=0; i<V; i++)
                {
                    if (i == now) continue;
                    if (distance[i] > distance[now] + e[now][i] + eps)
                    {
                        que.push(make_pair(distance[now] + e[now][i], i));
                    }
                }
            }
        }
    }
};

int N;
lint xs, ys, xt, yt;
vector<int> r;
vector<P> x;

double d(P p1, P p2)
{
    return sqrt((double)((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second)));
}

int main()
{
    cin >> xs >> ys >> xt >> yt >> N;
    r.resize(N);
    x.resize(N);
    for (int i=0; i<N; i++) cin >> x[i].first >> x[i].second >> r[i];

    Dijkstra dij(N+2, 1E10);
    for (int i=0; i<N; i++)
    {
        dij.update_edge(i+1, 0, max(d(make_pair(xs, ys), x[i]) - r[i], 0.0));
        dij.update_edge(i+1, N+1, max(d(make_pair(xt, yt), x[i]) - r[i], 0.0));
        for (int j=0; j<i; j++)
        {
            dij.update_edge(i+1, j+1, max(0.0, d(x[i], x[j]) - r[i] - r[j]));
        }
    }
    dij.update_edge(0, N+1, d(make_pair(xs, ys), make_pair(xt, yt)));

    cout << set_ << dij.dijkstra(0, N+1) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:13: error: 'set_' was not declared in this scope
   82 |     cout << set_ << dij.dijkstra(0, N+1) << endl;
      |             ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>

using namespace std;

typedef long long ll;

double dis[1002][1002];
double px[1002], py[1002], r[1002];
double cost[1002];
bool used[1002];

double euclid(int i, int j){
    double square = (px[i] - px[j])*(px[i] - px[j]) + (py[i] - py[j])*(py[i] - py[j]);
    return sqrt(square);
}

void dijkstra(int s, int N){
    cost[s] = 0.0;

    while(true){
        int v = -1;
        for(int u = 0; u < N+2; u++){
            if(!used[u] && (v == -1 || cost[u] < cost[v]))  v = u;
        }
        if(v == -1) break;
        used[v] = true;

        for(int u = 0; u < N+2; u++){
            cost[u] = min(cost[u], cost[v]+dis[v][u]);
        }
    }
}

int main(){
    double xs, ys, xt, yt;
    cin >> xs >> ys >> xt >> yt;
    int N; cin >> N;
    px[0] = xs; py[0] = ys; r[0] = 0.0;
    px[N+1] = xt; py[N+1] = yt; r[N+1] = 0.0;

    for(int i = 1; i <= N; i++){
        double x, y, rr; cin >> x >> y >> rr;
        px[i] = x; py[i] = y; r[i] = rr;
    }

    for(int i = 0; i < N+2; i++){
        for(int j = 0; j < N+2; j++){
            dis[i][j] = max(euclid(i, j) - r[i] - r[j], 0.0);
        }
        used[i] = false;
        cost[i] = 1e9 * 5;
    }

    dijkstra(0, N);
    printf("%.10f", cost[N+1]);

    return 0;
}

Compiler output:
a.cc: In function 'double euclid(int, int)':
a.cc:21:12: error: 'sqrt' was not declared in this scope
   21 |     return sqrt(square);
      |            ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

const int N = 1010;

struct node
{
	int x,y,r;
} a[N];

struct edge
{
	int v;
	double cost;
	edge(int x,double b):v(x),cost(b){};
};
int n;
double d[N];
bool vis[N];

vector<edge> G[N];

double cal(int i,int j)
{
	double sum = a[i].r + a[j].r;
	double xx = 1.0 * (a[i].x - a[j].x) * (a[i].x - a[j].x);
	double yy = 1.0 * (a[i].y - a[j].y) * (a[i].y - a[j].y);
	double ans = sqrt();
	if (sum >= ans) return 0;
	else return ans - sum;
}

void dij(void)
{
	for (int i = 0;i <= n + 1;i++) d[i] = 1e30;
	d[0] = 0;
	for (int i = 0;i <= n;i++)
	{
		double mi = 1e30;
		int x;
		for (int j = 0;j <= n + 1;j++)
		{
			if (!vis[j] && d[j] < mi)
			{
				mi = d[j];
				x = j;
			}
		}
		if (mi == 1e30) break;
		vis[x] = 1;
		for (auto e : G[x])
		{
			double cost = e.cost;
			int v = e.v;
			if (d[v] > cost + d[x])
			{
				d[v] = cost + d[x];
			}
		}
	}
}

int main()
{
	scanf("%d%d",&a[0].x,&a[0].y);
	a[0].r = 0;
	int x,y;
	scanf("%d%d",&x,&y);
	scanf("%d",&n);
	a[n+1].x = x,a[n+1].y = y,a[n+1].r = 0;
	for (int i = 1;i <= n;i++) scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].r);
	for (int i = 0;i <= n + 1;i++)
	{
		for (int j = i + 1;j <= n + 1;j++)
		{
			double len = cal(i,j);
			G[i].push_back(edge(j,len));
			G[j].push_back(edge(i,len));
		}
	}
	dij();
	printf("%.15f\n",d[n+1]);
	return 0;
}

Compiler output:
a.cc: In function 'double cal(int, int)':
a.cc:32:26: error: no matching function for call to 'sqrt()'
   32 |         double ans = sqrt();
      |                      ~~~~^~
In file included from /usr/include/c++/14/math.h:36,
                 from a.cc:3:
/usr/include/c++/14/cmath:454:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp)'
  454 |     sqrt(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:454:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: candidate: 'double sqrt(double)'
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/cmath:446:3: note: candidate: 'constexpr long double std::sqrt(long double)'
  446 |   sqrt(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:446:3: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/cmath:442:3: note: candidate: 'constexpr float std::sqrt(float)'
  442 |   sqrt(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:442:3: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct node
{
    int x,y,r;
}s[1005];

int n;
double map1[1005][1005],double d[1005];
bool vis[1005];

long double cal(node a,node b)
{
    return (long double)sqrt((long double)(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
void dijkstra(int s)
{
    d[s]=0;
    while(1)
    {
        int v=-1;
        for(int i=0; i<=n+1; i++)
        {
            if(!vis[i] && (v==-1 || d[i]<d[v]))
            v=i;
        }
        if (v==-1) break;
        vis[v]=1;
        for(int i=0; i<=n+1;i++)
        d[i]=min(d[i],d[v]+map1[v][i]);
    }
}

int main()
{
    int x1,y1;
    scanf("%d%d%d%d",&s[0].x,&s[0].y,&x1,&y1);
    scanf("%d",&n);
    s[n+1].x=x1;
    s[n+1].y=y1;
    for(int i=1;i<=n;i++)
    {
        scanf("%d%d%d",&s[i].x,&s[i].y,&s[i].r);
    }
    for(int i=0; i<=n+1; i++)
    {
        for(int j=i+1; j<=n+1; j++)
        {
            map1[i][j]=cal(s[i],s[j]);
            map1[i][j]-=s[i].r+s[j].r;
            if(map1[i][j]<0)
                map1[i][j]=0;
            map1[j][i]=map1[i][j];
        }
    }
    for(int i=0; i<=n+1; i++)
        d[i]=1e37;
    dijkstra(0);
    printf("%lf\n",d[n+1]);
    return 0;
}


Compiler output:
a.cc:9:25: error: expected unqualified-id before 'double'
    9 | double map1[1005][1005],double d[1005];
      |                         ^~~~~~
a.cc: In function 'void dijkstra(int)':
a.cc:18:5: error: 'd' was not declared in this scope
   18 |     d[s]=0;
      |     ^
a.cc: In function 'int main()':
a.cc:57:9: error: 'd' was not declared in this scope
   57 |         d[i]=1e37;
      |         ^
a.cc:59:20: error: 'd' was not declared in this scope
   59 |     printf("%lf\n",d[n+1]);
      |                    ^
Language: C++

#include <cstdio>
#include <queue>
#include <functional>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)

typedef pair<double, int> P;

const int N_MAX = 1000;
const int V_MAX = N_MAX + 2;
const double INF = 1e10;

int xs, ys, xt, yt;
int N;
int x[V_MAX];
int y[V_MAX];
int r[V_MAX];

int V;
double d[V_MAX];

void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d, d + V, INF);
  d[s] = 0.0;
  que.push(P(0, s));
  while (!que.empty()) {
    P p = que.top(); que.pop();
    int v = p.second;
    if (d[v] < p.first) continue;
    REP(u, V) {
      double dist = sqrt((x[u] - x[v]) * (x[u] - x[v]) + (y[u] - y[v]) * (y[u] - y[v]));
      dist = max(dist - r[u] - r[v], 0.0);
      if (d[u] > d[v] + dist) {
        d[u] = d[v] + dist;
        que.push(P(d[u], u));
      }
    }
  }
}

void solve() {
  V = N + 2;
  x[0] = xs; x[V - 1] = xt;
  y[0] = ys; y[V - 1] = yt;
  r[0] = r[V - 1] = 0;
  dijkstra(0);
  printf("%.10f\n", d[V - 1]);
}

void input() {
  scanf("%d%d%d%d", &xs, &ys, &xt, &yt);
  scanf("%d", &N);
  FOR(i, 1, N) scanf("%d%d%d", x + i, y + i, r + i);
}

int main() {
  input();
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:35:21: error: 'sqrt' was not declared in this scope
   35 |       double dist = sqrt((x[u] - x[v]) * (x[u] - x[v]) + (y[u] - y[v]) * (y[u] - y[v]));
      |                     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;

#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
typedef long long ll;
typedef long double ld;
///////////////////

int const N = 1e3 + 41;
ld const INF = 9e18 + 41;

int n;
ld xa, ya, xb, yb;
ld x[N], y[N], r[N];
int w[N];
ld d[N];
ld ans;

ld sqr(ld x){
	return x * x;
}

ld getdist(ld x0, ld y0, ld x1, ld y1){
	return sqrt( sqr(x0 - x1) + sqr(y0 - y1) );
}

void solve(){
	fi(0, n) d[i] = INF;
	fi(0, n){
		d[i] = max((ld)0, getdist(xa, ya, x[i], y[i]) - r[i]);
	}
	while(1){
		int id = -1;
		fi(0, n){
			if(!w[i] && (id == -1 || d[id] > d[i])){
				id = i;
			}
		}
		if(id == -1) break;
		w[id] = 1;
		fi(0, n){
			if(w[i]) continue;
			if(i == id) continue;
			ld d0 = d[id] + max((ld)0, getdist(x[i], y[i], x[id], y[id]) - r[id] - r[i]);
			d[i] = min(d[i], d0);
		}
	}
	ans = INF;
	fi(0, n){
		ld pans = d[i] + max((ld)0, getdist(xb, yb, x[i], y[i]) - r[i]);
		ans = min(ans, pans);
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	scanf("%Lf %Lf %Lf %Lf",&xa,&ya,&xb,&yb);
	scanf("%d",&n);
	fi(0, n) scanf("%Lf %Lf %Lf",&x[i],&y[i],&r[i]);
	
	solve();

	printf("%.15Lf\n",ans);

	return 0;
}

Compiler output:
a.cc: In function 'ld getdist(ld, ld, ld, ld)':
a.cc:28:16: error: 'sqrt' was not declared in this scope; did you mean 'sqr'?
   28 |         return sqrt( sqr(x0 - x1) + sqr(y0 - y1) );
      |                ^~~~
      |                sqr