Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define int long long



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int  n,a,b;
    cin >> n >> a >> b;
    a--;b--;
    vector<int> x(n),y(n);
    rep(i,n){
        int c,d;
        cin >> c >> d;
        x[i] = c+d;
        y[i] = c-d;
    }
    int d = max(abs(x[a]-x[b]),abs(y[a]-y[b]));
    map<int,set<int>  > mpx,mpy;
    map<int,vector<int>  > mpx2,mpy2;
    map<pair<int,int>,int > num;
    rep(i,n){
        mpx2[x[i]].push_back(y[i]);
        mpy2[y[i]].push_back(x[i]);
        if(i==a)continue;
        num[MP(x[i],y[i])] = i;
        mpx[x[i]].insert(y[i]);
        mpy[y[i]].insert(x[i]);
    }
    for(auto &aa:mpx2){
        vector<int>&aaa = aa.second;
        sort(aaa.begin(),aaa.end());
    }
    for(auto &aa:mpy2){
        vector<int>&aaa = aa.second;
        sort(aaa.begin(),aaa.end());   
    }
    set<int> st;
    st.insert(a);
    queue<int> q;
    q.push(a);
    bool fa= 0;
    bool fb = 0;
    int res = 0;
    while(!q.empty()){
        int k = q.front();
        q.pop();
        
        int sx = x[k] + d;
        set<int>&t = mpx[sx];
        auto tmp = t.lower_bound(y[k]-d);
        vector<int> &p = mpx2[sx];
        int sss = upper_bound(p.begin(),p.end(),y[k]+d)-lower_bound(p.begin(),p.end(),y[k]-d);
        res += sss;
        while(tmp!=t.end()){
            int yy = (*tmp);
            if(yy<=y[k]+d){
                int cc = num[MP(sx,yy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = t.erase(tmp);
                mpy[y[cc]].erase(x[cc]);
            }else{
                break;
            }
        }
        sx = x[k] - d;
        t = mpx[sx];
        tmp = t.lower_bound(y[k]-d);
        &p = mpx2[sx];
        sss = upper_bound(p.begin(),p.end(),y[k]+d)-lower_bound(p.begin(),p.end(),y[k]-d);
        res += sss;
        
        while(tmp!=t.end()){
            int yy = (*tmp);
            if(yy<=y[k]+d){
                int cc = num[MP(sx,yy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = t.erase(tmp);
                mpy[y[cc]].erase(x[cc]);
            }else{
                break;
            }
        }
        int sy = y[k] + d;
        t = mpy[sy];
        tmp = t.lower_bound(x[k]-d);
        p = mpy2[sy];
        sss = lower_bound(p.begin(),p.end(),x[k]+d)-upper_bound(p.begin(),p.end(),x[k]-d);
        res += sss;
        
        while(tmp!=t.end()){
            int xx = (*tmp);
            if(xx<=x[k]+d){
                int cc = num[MP(xx,sy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = t.erase(tmp);
                mpx[x[cc]].erase(y[cc]);
            }else{
                break;
            }
        }
        sy = y[k]-d;
        t = mpy[sy];
        tmp = t.lower_bound(x[k]-d);
        p = mpy2[sy];
        sss = lower_bound(p.begin(),p.end(),x[k]+d)-upper_bound(p.begin(),p.end(),x[k]-d);
        res += sss;
        
        while(tmp!=t.end()){
            int xx = (*tmp);
            if(xx<=x[k]+d){
                int cc = num[MP(xx,sy)];
                if(st.count(cc)==0){
                    st.insert(cc);
                    q.push(cc);
                }
                tmp = t.erase(tmp);
                mpx[x[cc]].erase(y[cc]);
            }else{
                break;
            }
        }
        //cerr << k << " " << res << endl;
    }
    // for(auto x:st){
    //     cerr << x << " ";
    // }
    // cerr << endl;
    cout << res/2 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:9: error: lvalue required as left operand of assignment
  101 |         &p = mpx2[sx];
      |         ^~