Language: C++

#include <bits/stdc++.h>
using namespace std;

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v; stringstream ss(s); string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}
#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

const int N = 100005;
unordered_set<int> g[N];
int deg[N];

struct UF {
    vector<int> par, rk;

    UF(int _n) {
        par.resize(_n + 1), rk.assign(_n + 1, 0);
        for (int i = 0; i <= _n; ++i) {
            par[i] = i;
        }
    }

    int find(int x) {
        if (x != par[x]) par[x] = find(par[x]);
        return par[x];
    }

    bool same(int x, int y) {
        return find(x) == find(y);
    }

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) return false;
        if (rk[x] < rk[y]) par[x] = y, deg[y] += deg[x];
        else {
            par[y] = x, deg[x] += deg[y];
            if (rk[x] == rk[y]) rk[x]++;
        }
        return true;
    }
};

typedef pair<ll, int> P;

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	int n, a, b; cin >> n >> a >> b; --a, --b;
	vector<int> xs(n), ys(n);
	unordered_map<int, set<P>> mp1; // x+y
	unordered_map<int, set<P>> mp2; // x-y
	REPU(i, 0, n) {
		int x, y; cin >> x >> y;
		xs[i] = x, ys[i] = y;
		mp1[x + y].push_back(P(x - y, i));
		mp2[x - y].push_back(P(x + y, i));
	}
	int d = abs(xs[a] - xs[b]) + abs(ys[a] - ys[b]);
	REPU(i, 0, n) {
		{
			ll f1 = xs[i] + ys[i];
			ll f2 = f1 - d;
			auto& st = mp1[f2];
			ll tmp = xs[i] - ys[i]; tmp -= d;
			auto it = st.lower_bound(P(tmp, -1));
			while (it != st.end()) {
				int v = (*it).second;
				g[i].insert(v); g[v].insert(i);
			}
		}
		{
			ll f1 = xs[i] - ys[i];
			ll f2 = f1 - d;
			auto& st = mp2[f2];
			ll tmp = xs[i] + ys[i]; tmp -= d;
			auto it = st.lower_bound(P(tmp, -1));
			for (int v : st) {
				int v = (*it).second;
				g[i].insert(v); g[v].insert(i);
			}
		}
	}
	REPU(i, 0, n) deg[i] = g[i].size();
	UF uf(n);
	REPU(i, 0, n) {
		for (int v : g[i]) if (i < v) {
			uf.unite(i, v);
		}
	}
	int ans = deg[uf.find(a)] >> 1;
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:80:28: error: 'std::unordered_map<int, std::set<std::pair<long long int, int> > >::mapped_type' {aka 'class std::set<std::pair<long long int, int> >'} has no member named 'push_back'
   80 |                 mp1[x + y].push_back(P(x - y, i));
      |                            ^~~~~~~~~
a.cc:81:28: error: 'std::unordered_map<int, std::set<std::pair<long long int, int> > >::mapped_type' {aka 'class std::set<std::pair<long long int, int> >'} has no member named 'push_back'
   81 |                 mp2[x - y].push_back(P(x + y, i));
      |                            ^~~~~~~~~
a.cc:102:38: error: cannot convert 'const std::pair<long long int, int>' to 'int' in initialization
  102 |                         for (int v : st) {
      |                                      ^~
a.cc:103:37: error: redeclaration of 'int v'
  103 |                                 int v = (*it).second;
      |                                     ^
a.cc:102:34: note: 'int v' previously declared here
  102 |                         for (int v : st) {
      |                                  ^