Language: C++

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx2")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <unordered_set>
#include <random>
#include <cmath>
#include <cassert>

struct xorshift64 {
  unsigned long long int x = 88172645463325252ULL;
  inline unsigned short nextUShort() {
    x = x ^ (x << 7);
    return x = x ^ (x >> 9);
  }
  inline unsigned int nextUShortMod(unsigned long long int mod) {
    x = x ^ (x << 7);
    x = x ^ (x >> 9);
    return ((x & 0x000000000000ffff) * mod) >> 48;
  }
  inline unsigned int nextUInt() {
    x = x ^ (x << 7);
    return x = x ^ (x >> 9);
  }
  inline unsigned int nextUIntMod(unsigned long long int mod) {
    x = x ^ (x << 7);
    x = x ^ (x >> 9);
    return ((x & 0x00000000ffffffff) * mod) >> 32;
  }
  inline unsigned long long int nextULL() {
    x = x ^ (x << 7);
    return x = x ^ (x >> 9);
  }
  inline double nextDouble() {
    x = x ^ (x << 7);
    x = x ^ (x >> 9);
    return (double)x * 5.42101086242752217e-20;
  }
};

struct timer {
  double t = 0.0;
  timer() {
    restart();
  }
  inline void restart() {
    t = now();
  }
  inline double time() {
    return now() - t;
  }
  inline double now() {
    unsigned long long l, h;
    __asm__ ("rdtsc" : "=a"(l), "=d"(h));
    return (double)(l | h << 32) * 3.5714285714285715e-10; // 1 / 2.8e9
  }
};

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 1000000007;

timer theTimer;
xorshift64 theRandom;

//#define DEBUG

int n, k;
vector<double> x, y, c;
double px, py;

double calcScore() {
  vector<double> timeNeeded(n);
  for (int i = 0; i < n; i++) timeNeeded[i] = c[i] * sqrt((px - x[i]) * (px - x[i]) + (py - y[i]) * (py - y[i]));
  nth_element(timeNeeded.begin(), timeNeeded.begin() + k - 1, timeNeeded.end());
  return timeNeeded[k-1];
}

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

  // input
  cin >> n >> k;
  x = vector<double>(n);
  y = vector<double>(n);
  c = vector<double>(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> c[i];

  // preprocessing
  priority_queue<vector<double> > pque;
  double bestpx = 0.0;
  double bestpy = 0.0;
  double bestScorePre = 1e308;
  for (int i = -1000; i <= 1000; i += 2) {
    for (int j = -1000; j <= 1000; j += 2) {
      px = i;
      py = j;
      double score = calcScore();
      if (score < bestScorePre) {
        bestpx = px;
        bestpy = py;
        bestScorePre = score;
      }
      pque.push_back(vector<double>({-score, bestpx, bestpy}));
    }
  }
  for (int j = 0; j < 10; j++) {
    auto now = pque.top();
    pque.pop();
    double tx = now[1];
    double ty = now[2];
    for (int i = 0; i < 10000; i++) {
      px = tx + theRandom.nextDouble() * 4.0 - 2.0;
      py = ty + theRandom.nextDouble() * 4.0 - 2.0;
      double score = calcScore();
      if (score < bestScorePre) {
        bestpx = px;
        bestpy = py;
        bestScorePre = score;
      }
    }
  }
  px = bestpx;
  py = bestpy;

  // optimization
  double score = calcScore();
  double lastScore = score;
  double bestScore = score;

  double baseTemperature = 1e2;
  double temperature = baseTemperature;
  double decayRate = 5e-6;
  double maxDelta = 1.0;
  double deltaLimit = 0.0001;
  double deltaDecayRate = 5e-6;
  double timeLimit = 1.900;
  int iterCount = 0;

  while (theTimer.time() < timeLimit) {
    double dx = theRandom.nextDouble() * maxDelta * 2.0 - maxDelta;
    double dy = theRandom.nextDouble() * maxDelta * 2.0 - maxDelta;
    if (theRandom.nextDouble() < 0.001) dx = 0.0;
    if (theRandom.nextDouble() < 0.001) dy = 0.0;

    px += dx;
    py += dy;

    score = calcScore();

    #ifdef DEBUG
    if (iterCount % 100000 == 0) cerr << iterCount << " " << score << " " << lastScore << " " << bestScore << " " << temperature << " " << endl;
    #endif

    if (score <= lastScore) {
      lastScore = score;
      if (score < bestScore) {
        bestScore = score;
        bestpx = px;
        bestpy = py;
      }
    }
    else if (theRandom.nextDouble() < exp(double(lastScore - score) / temperature)) { // accept
      lastScore = score;
    }
    else { // rollback
      px -= dx;
      py -= dy;
    }

    if (theRandom.nextDouble() < 0.0001) {
      px = bestpx;
      py = bestpy;
      lastScore = bestScore;
    }

    iterCount++;
    temperature *= 1.0 - decayRate;
    if (maxDelta > deltaLimit) maxDelta *= 1.0 - deltaDecayRate;
  }

  cerr << "iterCount   = " << iterCount << endl;
  cerr << "temperature = " << temperature << endl;
  cerr << "bestScore   = " << bestScore << endl;

  // postprocess & output
  cout << setprecision(16) << bestScore << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:116:12: error: 'class std::priority_queue<std::vector<double> >' has no member named 'push_back'
  116 |       pque.push_back(vector<double>({-score, bestpx, bestpy}));
      |            ^~~~~~~~~