Language: C++

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

#define rep(i, s, t) for(int i = (s); i < (t); ++i)
using namespace std;

typedef long long ll;
const double EPS = 0.0000000001;

bool equals(double a, double b) {
    return (fabs(a-b) < EPS);
}

struct Vector {
    double x;
    double y;
    explicit Vector(double _x = 0, double _y = 0) : x(_x), y(_y) {}

    Vector& operator+=(const Vector& rhs) {
        x += rhs.x;
        y += rhs.y;
        return *this;
    }

    Vector& operator-=(const Vector& rhs) {
        x -= rhs.x;
        y -= rhs.y;
        return *this;
    }

    Vector& operator*=(double ratio) {
        x *= ratio;
        y *= ratio;
        return *this;
    }

    Vector operator+(const Vector& rhs) const {
        Vector ret(*this);
        return ret+=rhs;
    }

    Vector operator-(const Vector& rhs) const {
        Vector ret(*this);
        return ret-=rhs;
    }

    Vector operator*(double ratio) const {
        Vector ret(*this);
        return ret*=ratio;
    }

    double norm2() const {
        return (x*x + y*y);
    }

    double norm() const {
        return sqrt(norm2());
    }

    Vector rotateDeg(int deg) {
        double c = 0, s = 1.0;
        if (deg != 90) {
            double rad = M_PI * deg / 180.0;
            c = cos(rad);
            s = sin(rad);
        }
        return Vector(c*x-s*y, s*x+c*y);
    }
};


struct Circle {
    Vector o;
    double r;
    explicit Circle(double ox = 0, double oy = 0, double _r = 0) : o(ox, oy), r(_r) {}
    double area() const {
        return M_PI * r * r;
    }

    bool includes(const Vector& p) {
        return ((p-o).norm() <= r+EPS);
    }

    vector<Vector> intersections(const Circle& rhs) const {
        vector<Vector> ret;
        if (r < rhs.r) {
            //! we ensures rhs.r <= r
            ret = rhs.intersections(*this);
        } else {
            double dist = (o-rhs.o).norm();
            if (EPS < dist) {
                if (equals(dist, r+rhs.r) || equals(dist, r-rhs.r)) {
                    //! this and rhs touch with each other
                    ret.push_back(o + (rhs.o-o) * (r/dist));
                } else if (r-rhs.r < dist && dist < r+rhs.r) {
                    //! have two intersections
                    double x = (dist*dist + r*r - rhs.r*rhs.r) / (2.0*dist);
                    double y = sqrt(r*r - x*x);
                    Vector v1 = rhs.o-o; //! o to rhs.o
                    Vector v2 = v1 * (x / v1.norm()); //! o to the intersection of line o-rhs.o and the line connecting the two intersections of the circles
                    Vector v3 = (v1 * (y / v1.norm())).rotateDeg(90);
                    ret.push_back(o + v2 + v3);
                    ret.push_back(o + v2 - v3);
                }
            }
        }
        return ret;
    }
};

int n, k;


signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(0);
  cin >> n >> k;
  vector<Circle> cs(n);
  vector<int> c(n);
  rep(i, 0, n) cin >> cs[i].o.x >> cs[i].o.y >> c[i];

  std::function<bool(double)> C = [&](double T)=
  {
    rep(i, 0, n) cs[i].r = T/double(c[i]); //given c[i]!=0
    //point is intersection of itself
    vector<Vector> all_candicates;
    rep(i, 0, n)rep(j, 0, n)
    {
      auto cur = cs[i].intersections(cs[j]);
      all_candicates.insert(all_candicates.end(), cur.begin(), cur.end());
    }
    for(auto x : all_candicates)
    {
      bool inall = 1;
      rep(i, 0, n) inall &= c[i].includes(x);
      if(inall) return true;
    }
    return false;
  };

  double L = 0, R = 5000.0; //
  double M;
  const double ans_eps = 1e7;
  while(R-L > 1e7)
  {
    M = (L+R)/2.0;
    if(C(M)) L = M;
    else R = M;
  }
  cout << L << endl;

  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:123:48: error: expected '{' before '=' token
  123 |   std::function<bool(double)> C = [&](double T)=
      |                                                ^
a.cc: In function 'int main()':
a.cc:4:22: error: expected primary-expression before 'for'
    4 | #define rep(i, s, t) for(int i = (s); i < (t); ++i)
      |                      ^~~
a.cc:125:5: note: in expansion of macro 'rep'
  125 |     rep(i, 0, n) cs[i].r = T/double(c[i]); //given c[i]!=0
      |     ^~~
a.cc:4:22: error: expected '}' before 'for'
    4 | #define rep(i, s, t) for(int i = (s); i < (t); ++i)
      |                      ^~~
a.cc:125:5: note: in expansion of macro 'rep'
  125 |     rep(i, 0, n) cs[i].r = T/double(c[i]); //given c[i]!=0
      |     ^~~
a.cc:124:3: note: to match this '{'
  124 |   {
      |   ^
a.cc:4:22: error: no match for 'operator=' (operand types are 'main()::<lambda(double)>' and '<brace-enclosed initializer list>')
    4 | #define rep(i, s, t) for(int i = (s); i < (t); ++i)
      |                      ^~~
a.cc:125:5: note: in expansion of macro 'rep'
  125 |     rep(i, 0, n) cs[i].r = T/double(c[i]); //given c[i]!=0
      |     ^~~
a.cc:123:37: note: candidate: 'main()::<lambda(double)>& main()::<lambda(double)>::operator=(const main()::<lambda(double)>&)' (deleted)
  123 |   std::function<bool(double)> C = [&](double T)=
      |                                     ^
a.cc:123:37: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const main()::<lambda(double)>&'
a.cc:125:9: error: 'i' was not declared in this scope
  125 |     rep(i, 0, n) cs[i].r = T/double(c[i]); //given c[i]!=0
      |         ^
a.cc:4:39: note: in definition of macro 'rep'
    4 | #define rep(i, s, t) for(int i = (s); i < (t); ++i)
      |                                       ^
a.cc:136:34: error: request for member 'includes' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
  136 |       rep(i, 0, n) inall &= c[i].includes(x);
      |                                  ^~~~~~~~
a.cc: At global scope:
a.cc:145:3: error: expected unqualified-id before 'while'
  145 |   while(R-L > 1e7)
      |   ^~~~~
a.cc:151:3: error: 'cout' does not name a type
  151 |   cout << L << endl;
      |   ^~~~
a.cc:153:3: error: expected unqualified-id before 'return'
  153 |   return 0;
      |   ^~~~~~
a.cc:154:1: error: expected declaration before '}' token
  154 | }
      | ^