<commit_before>// Closest Pair of Points - O(nlogn)
point p[N];

ld closest_pair_util(point p[], int n) {
  if (n <= 3) {
    ld ans = p[0].dist(p[1]);
    for (int i = 0; i < n; i++) for (int j = i+1; j < n; j++)
      ans = min(ans, p[i].dist(p[j]));
    return ans;
  }

  int mid = n/2;
  point mp = p[mid];
  ld d = min(closest_pair_util(p, mid), closest_pair_util(p+mid, n-mid));

  point strip[n];
  int sz = 0;
  for (int i = 0; i < n; i++) if ((p[i].x - mp.x)*(p[i].x - mp.x) < d) strip[sz++] = p[i];

  sort(strip, strip+sz, [](point s, point t){ return s.y > t.y; });
  for (int i = 0; i < sz; i++) for (int j = i+1; j < sz and (strip[i].y - strip[j].y)*(strip[i].y - strip[j].y) < d; j++)
    d = min(d, strip[i].dist(strip[j]));

  return d;
}<commit_msg>Update closest-pair.cpp<commit_after>// Closest Pair of Points - O(nlogn)
point p[N];

ld closest_pair_util(point p[], int n) {
  if (n <= 3) {
    ld ans = p[0].dist(p[1]);
    for (int i = 0; i < n; i++) for (int j = i+1; j < n; j++)
      ans = min(ans, p[i].dist(p[j]));
    return ans;
  }

  int mid = n/2;
  point mp = p[mid];
  ld d = min(closest_pair_util(p, mid), closest_pair_util(p+mid, n-mid));

  point strip[n];
  int sz = 0;
  for (int i = 0; i < n; i++) if ((p[i].x - mp.x)*(p[i].x - mp.x) < d) strip[sz++] = p[i];

  sort(strip, strip+sz, [](point s, point t){ return s.y > t.y; });
  for (int i = 0; i < sz; i++) for (int j = i+1; j < sz and strip[i].y - strip[j].y < d; j++)
    d = min(d, strip[i].dist(strip[j]));

  return d;
}
{'fraction_non_alphanumeric': 0.24242424242424243, 'fraction_numerical': 0.013175230566534914, 'mean_word_length': 2.732186732186732, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1173815', 'n_tokens_mistral': 715, 'n_tokens_neox': 686, 'n_words': 204}