Language: C++

#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

using ld = double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;
ll n,m;
ld cross(const P& a, const P& b) { return a.real()*b.imag() - a.imag()*b.real(); }
ld dot(const P& a, const P& b) { return a.real()*b.real() + a.imag()*b.imag(); }

using C = pair<ld, P>;
#define rad first
#define pnt second

C smallest_enclosing_disc(vector<P> ps){
    auto c3 = [](const P &a, const P &b, const P &c){
        ld A = norm(b - c);
        ld B = norm(c - a);
        ld C = norm(a - b);
        ld S = abs(cross(b - a, c - a));
        P p = (A*(B+C-A)*a + B*(C+A-B)*b + C*(A+B-C)*c) / (4*S*S);
        ld r = abs(p - a);
        return make_pair(r, p);
    };

    auto c2 = [](const P &a, const P &b){
        P c = (a + b) / (ld)2;
        ld r = abs(a - c);
        return make_pair(r, c);
    };

    auto in_circle = [](const P &a, const C &c){
        return norm(a - c.pnt) <= c.rad*c.rad + eps;
    };

    int n = ps.size();
    random_shuffle(ps.begin(), ps.end());
    C c = c2(ps[0], ps[1]);
    for(int i = 2; i < n; ++i){
        if(!in_circle(ps[i], c)){
            c = c2(ps[0], ps[i]);
            for(int j = 1; j < i; ++j){
                if(!in_circle(ps[j], c)){
                    c = c2(ps[j], ps[i]);
                    for(int k = 0; k < j; ++k){
                        if(!in_circle(ps[k], c)){
                            c = c3(ps[i], ps[j], ps[k]);
                        }
                    }
                }
            }
        }
    }
    return c;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  G g(n);
  for(int i=0;i<n;i++){
    ld x,y;cin>>x>>y;
    g[i] = mp(x,y);
  }
  printf("%.15lf\n",(double)smallest_enclosing_disc(ps).rad);
  return 0;
}


Compiler output:
a.cc: In function 'C smallest_enclosing_disc(std::vector<std::complex<double> >)':
a.cc:54:19: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<complex<double>*, vector<complex<double> > >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   54 |     random_shuffle(ps.begin(), ps.end());
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4492:5: note: declared here
 4492 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:80:18: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::complex<double> >, std::complex<double> >::value_type' {aka 'std::complex<double>'} and 'std::pair<double, double>')
   80 |     g[i] = mp(x,y);
      |                  ^
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:1614:9: note: candidate: 'template<class _Tp> std::complex<double>& std::complex<double>::operator=(const std::complex<_Tp>&)'
 1614 |         operator=(const complex<_Tp>& __z)
      |         ^~~~~~~~
/usr/include/c++/14/complex:1614:9: note:   template argument deduction/substitution failed:
a.cc:80:18: note:   'std::pair<double, double>' is not derived from 'const std::complex<_Tp>'
   80 |     g[i] = mp(x,y);
      |                  ^
/usr/include/c++/14/complex:1573:7: note: candidate: 'std::complex<double>& std::complex<double>::operator=(double)'
 1573 |       operator=(double __d)
      |       ^~~~~~~~
/usr/include/c++/14/complex:1573:24: note:   no known conversion for argument 1 from 'std::pair<double, double>' to 'double'
 1573 |       operator=(double __d)
      |                 ~~~~~~~^~~
/usr/include/c++/14/complex:1609:37: note: candidate: 'constexpr std::complex<double>& std::complex<double>::operator=(const std::complex<double>&)'
 1609 |       _GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default;
      |                                     ^~~~~~~~
/usr/include/c++/14/complex:1609:47: note:   no known conversion for argument 1 from 'std::pair<double, double>' to 'const std::complex<double>&'
 1609 |       _GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default;
      |                                               ^~~~~~~~~~~~~~
a.cc:82:53: error: 'ps' was not declared in this scope; did you mean 'pi'?
   82 |   printf("%.15lf\n",(double)smallest_enclosing_disc(ps).rad);
      |                                                     ^~
      |                                                     pi