Language: C++

#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ll long long
#define pii pair <int, int>
#define X first
#define Y second

using namespace std;

const int OFF = (1 << 15);
vector <int> ve[OFF * 2];
int bio[2 * OFF], low[2 * OFF], scc[2 * OFF];
int cnt = 0, ind = 0, n;
stack <int> st;
int on_stack[2 * OFF];
int index[2 * OFF];
vector <pii> tmp;

void dfs(int x) {
  bio[x] = low[x] = cnt++;
  st.push(x);
  on_stack[x] = 1;

  for (int y : ve[x]) {
    if (bio[y] == -1) {
      dfs(y);
      low[x] = min(low[x], low[y]); 
    } else if (on_stack[y]) {
      low[x] = min(low[x], bio[y]);
    }
  }

  if (low[x] == bio[x]) {
    while (st.size()) {
      int y = st.top();
      st.pop();
      on_stack[y] = 0;
      scc[y] = ind;
      if (y == x) break;
    }
    ind++;
  }

  return;
}

void tarjan(int N) {
  cnt = 1, ind = 0;
  memset(scc, -1, sizeof scc);
  memset(bio, -1, sizeof bio);

  REP(i, N) {
    if (bio[i] == -1) dfs(i);
  }

  return;
}

void connect(int a, int b, int k, int lo = 0, int hi = OFF, int x = 1) {
  if (b <= lo || hi <= a) return;
  if (a <= lo && hi <= b) {
    ve[k].push_back(x);
    return;
  }

  int mi = (lo + hi) / 2;
  connect(a, b, k, lo, mi, x * 2);
  connect(a, b, k, mi, hi, x * 2 + 1);

  return;
}

void generate(int D) {
  REP(i, OFF) ve[i + OFF].clear();

  int l = 0, r = 0;
  REP(i, 2 * n) {
    while (tmp[l].X < tmp[i].X - D) l++;
    while (r < 2 * n && tmp[r].X <= tmp[i].X + D) r++;

    connect(l + 2 * n, i + 2 * n, i + OFF);
    connect(i + 1 + 2 * n, r + 2 * n, i + OFF);
  }

  REP(i, n) {
    int a = index[2 * i];
    int b = index[2 * i + 1];

    ve[a + OFF].push_back(b + 2 * n + OFF);
    ve[b + OFF].push_back(a + 2 * n + OFF);
    ve[b + 2 * n + OFF].push_back(a + OFF);
    ve[a + 2 * n + OFF].push_back(b + OFF);
  }

  return;
}

bool check(int mi) {
  generate(mi);
  tarjan(2 * OFF);

  bool flag = 1;
  REP(i, 2 * n) {
    if (scc[i + OFF] == scc[i + 2 * n + OFF]) flag = 0;
  }
  return flag;
}

int main() {
  ios_base::sync_with_stdio(false);

  FOR(i, 1, OFF) {
    ve[i].push_back(i * 2);
    ve[i].push_back(i * 2 + 1);
  }

  cin >> n;
  REP(i, 2 * n) {
    int a;
    cin >> a;
    tmp.push_back({a, i});
  }

  sort(tmp.begin(), tmp.end());
  REP(i, 2 * n) index[tmp[i].Y] = i;

/*
  generate(3);
  FOR(i, OFF, 2 * OFF) {
    cout << i << ": ";
    for (int x : ve[i]) cout << x << " ";
    cout << endl;
  } 

  tarjan(2 * OFF);
  REP(i, 2 * n) {
    cout << scc[i + OFF] << " " << scc[i + 2 * n + OFF] << endl;
  }
*/

  int lo = 0, hi = 1e9;
  while (lo < hi) {
    int mi = (lo + hi + 1) / 2;

    if (check(mi)) lo = mi;
    else           hi = mi - 1;
  }
  if (lo == 0 && !check(0)) cout << 0 << endl;
  else                      cout << lo + 1 << endl;

  return 0;
}

Compiler output:
a.cc:18:18: error: 'int index [65536]' redeclared as different kind of entity
   18 | int index[2 * OFF];
      |                  ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'void generate(int)':
a.cc:88:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   88 |     int a = index[2 * i];
      |                  ^
a.cc:89:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   89 |     int b = index[2 * i + 1];
      |                  ^
a.cc: In function 'int main()':
a.cc:127:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
  127 |   REP(i, 2 * n) index[tmp[i].Y] = i;
      |                      ^