Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const double eps = 1e-8;

///////////////////////////
//SIMPLEX
//WARNING: segfaults on empty (size 0)
//max cx st Ax<=b, x>=0
//do 2 phases; 1st check feasibility;
//2nd check boundedness & ans
///////////////////////////
vector<double> simplex(vector<vector<double> > A, vector<double> b, vector<double> c) {
  int n = (int) A.size(), m = (int) A[0].size()+1, r = n, s = m-1; 
  vector<vector<double> > D = vector<vector<double> > (n+2, vector<double>(m+1)); 
  vector<int> ix = vector<int> (n+m); 
  for (int i=0; i<n+m; i++) ix[i] = i; 
  for (int i=0; i<n; i++) {
    for (int j=0; j<m-1; j++)D[i][j]=-A[i][j]; 
    D[i][m-1] = 1; 
    D[i][m] = b[i]; 
    if (D[r][m] > D[i][m]) r = i; 
  }
  for (int j=0; j<m-1; j++) D[n][j]=c[j]; 
  D[n+1][m-1] = -1; int z = 0; 
  for (double d;;) {
    if (r < n) {
      swap(ix[s], ix[r+m]); 
      D[r][s] = 1.0/D[r][s]; 
      for (int j=0; j<=m; j++) if (j!=s) D[r][j] *= -D[r][s]; 
      for(int i=0; i<=n+1; i++)if(i!=r) {
        for (int j=0; j<=m; j++) if(j!=s) D[i][j] += D[r][j] * D[i][s]; 
        D[i][s] *= D[r][s]; 
      }
    }
    r = -1; s = -1; 
    for (int j=0; j <m; j++) if (s<0 || ix[s]>ix[j]) {
      if (D[n+1][j]>eps || D[n+1][j]>-eps && D[n][j]>eps) s = j; 
    }
    if (s < 0) break; 
    for (int i=0; i<n; i++) if(D[i][s]<-eps) {
      if (r < 0 || (d = D[r][m]/D[r][s]-D[i][m]/D[i][s]) < -eps
        || d < eps && ix[r+m] > ix[i+m]) r=i; 
    }
    if (r < 0) return vector<double>(); // unbounded
  }
  if (D[n+1][m] < -eps) return vector<double>(); // infeasible
  vector<double> x(m-1); 
  for (int i = m; i < n+m; i ++) if (ix[i] < m-1) x[ix[i]] = D[i-m][m];
  printf("%.2lf\n", D[n][m]);
  return x; // ans: D[n][m]
}

#define N 16
int n;
int px[N], py[N], pz[i];
double d[N][N];

double a[N];
int p[N];

bool cmp(int x, int y) {
	return fabs(p[x]) > fabs(p[y]);
}

bool can(double val) {
	for (int i = 0; i < n; i ++) 
		a[i] = pz[i]-val;
	while (true) {
		bool done = true;
		for (int i = 0; i < n; i ++) 
			if (a[i] < 0.0) done = false;
		if (done) return true;
		for (int i = 0; i < n; i ++) p[i] = i;
		sort(p, p+n, cmp);
		if (fabs(a[p[i]]) < eps) break;
		int j = p[0];
		int be = -1;
		for (int i = 0; i < n; i++) 
			if (fabs(a[i]) > eps && i != j && a[i] * a[j] < 0) {
				if (be == -1) be = i;
				else if (d[be][j] > d[i][j]) be = i;
			}
		if (a[j] < 0) swap(be, j);
		if (a[j] < d[be][j]) return false;
		double amt = a[j]-d[be][j];
		amt = min(amt, -a[be]);
		a[j] -= amt;
		a[be] += amt;
	}
	return false;
}

int main () {
	cin >> n;
	for (int i = 0; i < n; i ++)
		cin >> px[i] >> py[i] >> pz[i];
	for (int i = 0; i < n; i ++)
		for (int j = 0; j < n; j ++)
			d[i][j] = sqrt((px[i]-px[j])*(px[i]-px[j]) + (py[i]-py[j])*(py[i]-py[j]));
	
	double le = 0, ri = 1e9;
	for (int _ = 0; _ < 100; _++) {
		double mid = (le+ri)/2;
		if (can(mid)) le = mid;
		else ri = mid;
	}
	printf ("%.9lf\n", (le+ri)/2);
	/*
	int nc = n*n*2+1;
	int cc = n*n*2;
	vector<double> C(nc, 0.0);
	C[cc] = 1.0;
	
	vector<vector<double> > A;
	vector<double> B;
	
	for (int i = 0; i < n; i ++) {
		for (int j = 0; j < n; j ++) {
			vector<double> v(nc, 0.0);
			
		}
	}
	
	printf ("%.9lf\n", simplex(A, B, C));*/
	return 0;
}

Compiler output:
a.cc:64:22: error: 'i' was not declared in this scope
   64 | int px[N], py[N], pz[i];
      |                      ^
a.cc: In function 'bool can(double)':
a.cc:76:24: error: 'pz' was not declared in this scope; did you mean 'py'?
   76 |                 a[i] = pz[i]-val;
      |                        ^~
      |                        py
a.cc:84:30: error: 'i' was not declared in this scope
   84 |                 if (fabs(a[p[i]]) < eps) break;
      |                              ^
a.cc: In function 'int main()':
a.cc:105:42: error: 'pz' was not declared in this scope; did you mean 'py'?
  105 |                 cin >> px[i] >> py[i] >> pz[i];
      |                                          ^~
      |                                          py