Language: C++

#ifndef _WIN32
#include<iostream>
#endif 
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<tuple>
#include<complex>
#include<queue>
#include<functional>
using namespace std;
typedef long long LL;
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
template<typename T> bool chmin(T &l, T r) {
    bool res = l > r;
    if (res) {
        l = r;
    }
    return res;
}
#define IL inline
#define X real()
#define Y imag()
typedef complex<double> P;
typedef pair<P, P> LS;
typedef bool B;
typedef double D;
const D EPS = 1e-8;
IL D dot(P a, P b) {
    return a.X*b.X + a.Y*b.Y;
}
IL D cross(P a, P b) {
    return a.X*b.Y - a.Y*b.X;
}
     IL int sgn(P a,P b, P c){
        if(cross(b-a,c-a) > EPS)return 1;
        if(cross(b-a,c-a) < -EPS)return -1;
        if(dot(b-a,c-a) < -EPS)return 2; // b-a-c
        if(dot(a-b,c-b) < -EPS)return -2; // a-b-c
        return 0;
    }

 
 
struct cww {
    cww() {
        cout << fixed;
        cout << setprecision(10);
    }
}star;
 
IL D distance_P_LS(P p, LS ls) {
    P a, b, c = p;
    tie(a, b) = ls;
    if (dot(b - a, c - a) < EPS)return abs(c - a);
    if (dot(a - b, c - b) < EPS)return abs(c - b);
    return abs(cross(b - a, c - a)) / abs(b - a);
}
    IL B is_LS_LS(LS p, LS q) {
        P a, b, c, d;
        tie(a, b) = p;
        tie(c, d) = q;
        return sgn(a,b,c)*sgn(a,b,d) <= 0
            && sgn(c,d,a)*sgn(c,d,b) <= 0;
    }
 
    IL D distance_LS_LS(LS p,LS q){
        if(is_LS_LS)return 0;
        return min({
                distance_P_LS(p.fi,q),
                distance_P_LS(p.se,q),
                distance_P_LS(q.fi,p),
                distance_P_LS(q.se,p)    
                    });
    }

P rot(P p, double r) {
    return P(p.X*cos(r) - p.Y*sin(r), p.X*sin(r) + p.Y*cos(r));
}
 
const D PI = acos(-1);
const D FI = 72.0 / 180.0*PI;
typedef pair<double, int> pp;
const int ss[][2] = { {0,2},{0,3},{1,3},{1,4},{2,4} };
typedef priority_queue<pp, vector<pp>, greater<pp>> QUE;
int main() {
    int N, M, L;
    while (cin >> N >> M >> L, N) {
        vector<LS> ls(5*N);
        REP(i, N) {
            double x, y,a,r;
            cin >> x >> y >> a >> r;
            P p(x, y);
            vector<P> pt(5);
            pt[0] = rot(P(0, r), a/180.0*PI);
            REP(i, 4)pt[i + 1] = rot(pt[i], FI);
            REP(j, 5) {
                ls[i * 5 + j] = LS(p+pt[ss[j][0]], p+pt[ss[j][1]]);
            }
        }
        vector<vector<double>> dist(N * 5, vector<double>(N * 5));
        REP(i, 5*N)REP(j, 5*N) {
            if (i == j)dist[i][j] = 0;
            else dist[i][j] = distance_LS_LS(ls[i], ls[j]);
        }
        int S = 5 * (M - 1);
        int G = 5 * (L - 1);
 
 
 
 
 
        vector<double> res(N *5, 1e18);
        res[S] = 0;
        QUE que;
        que.push(pp(0,S));
        while (que.size()) {
            int v; double cost;
            tie(cost,v) = que.top();
            que.pop();
            if (cost > res[v])continue;
            REP(u, 5 * N) if(u!=v){
                double ncost = cost + dist[u][v];
                if (chmin(res[u], ncost))que.push(pp(ncost, u));
            }
        }
        cout << res[G] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'D distance_LS_LS(LS, LS)':
a.cc:74:33: error: 'LS' {aka 'struct std::pair<std::complex<double>, std::complex<double> >'} has no member named 'fi'
   74 |                 distance_P_LS(p.fi,q),
      |                                 ^~
a.cc:75:33: error: 'LS' {aka 'struct std::pair<std::complex<double>, std::complex<double> >'} has no member named 'se'
   75 |                 distance_P_LS(p.se,q),
      |                                 ^~
a.cc:76:33: error: 'LS' {aka 'struct std::pair<std::complex<double>, std::complex<double> >'} has no member named 'fi'
   76 |                 distance_P_LS(q.fi,p),
      |                                 ^~
a.cc:77:33: error: 'LS' {aka 'struct std::pair<std::complex<double>, std::complex<double> >'} has no member named 'se'
   77 |                 distance_P_LS(q.se,p)
      |                                 ^~
a.cc:73:19: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   73 |         return min({
      |                ~~~^~
   74 |                 distance_P_LS(p.fi,q),
      |                 ~~~~~~~~~~~~~~~~~~~~~~
   75 |                 distance_P_LS(p.se,q),
      |                 ~~~~~~~~~~~~~~~~~~~~~~
   76 |                 distance_P_LS(q.fi,p),
      |                 ~~~~~~~~~~~~~~~~~~~~~~
   77 |                 distance_P_LS(q.se,p)
      |                 ~~~~~~~~~~~~~~~~~~~~~
   78 |                     });
      |                     ~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided