Language: C

struct point
{
    double x, y;
} p[size];
int n, tmp[size];

bool cmpx(point a, point b)
{
    return a.x + eps < b.x || (a.x < b.x + eps && a.y + eps < b.y);
}

bool cmpy(int a, int b)
{
    return p[a].y + eps < p[b].y || (p[a].y < p[b].y + eps && p[a].x + eps < p[b].x);
}

double MinDist(int l, int r)
{
    int i, j;
    double ret = 1e200;
    if (r - l <= 10)
    {
        for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j]));
        return ret;
    }
    int mid = (l + r) >> 1, tot = 0;
    ret = min(ret, (min(MinDist(l, mid), MinDist(mid + 1, r)));
    for (i = mid; i >= l; i--)
        if (p[mid].x - p[i].x < ret) tmp[tot++] = i;
        else break;
    for (i = mid + 1; i <= r; i++)
        if (p[i].x - p[mid].x < ret) tmp[tot++] = i;
        else break;
    sort(tmp, tmp + tot, cmpy);
    for (i = 0; i < tot; i++)
        for (j = 1; j <= 7 && j + i < tot; j++) ret = min(ret, dis(p[tmp[i]], p[tmp[i + j]]));
    return ret;
}

Compiler output:
main.c:4:5: error: 'size' undeclared here (not in a function)
    4 | } p[size];
      |     ^~~~
main.c:7:1: error: unknown type name 'bool'
    7 | bool cmpx(point a, point b)
      | ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | struct point
main.c:7:11: error: unknown type name 'point'; did you mean 'int'?
    7 | bool cmpx(point a, point b)
      |           ^~~~~
      |           int
main.c:7:20: error: unknown type name 'point'; did you mean 'int'?
    7 | bool cmpx(point a, point b)
      |                    ^~~~~
      |                    int
main.c:12:1: error: unknown type name 'bool'
   12 | bool cmpy(int a, int b)
      | ^~~~
main.c:12:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'cmpy':
main.c:14:21: error: 'eps' undeclared (first use in this function)
   14 |     return p[a].y + eps < p[b].y || (p[a].y < p[b].y + eps && p[a].x + eps < p[b].x);
      |                     ^~~
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'MinDist':
main.c:23:68: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
   23 |         for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j]));
      |                                                                    ^~~
main.c:23:77: error: implicit declaration of function 'dis' [-Wimplicit-function-declaration]
   23 |         for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j]));
      |                                                                             ^~~
main.c:27:63: error: expected ')' before ';' token
   27 |     ret = min(ret, (min(MinDist(l, mid), MinDist(mid + 1, r)));
      |              ~                                                ^
      |                                                               )
main.c:37:16: error: expected ';' before '}' token
   37 |     return ret;
      |                ^
      |                ;
   38 | }
      | ~