Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N; cin>>N;
  vi A(N),B(N);
  priority_queue<pair<pii,int>> P,Q;
  rep(i,0,N){
    cin>>A[i]>>B[i];
    Q.push(mp(A[i]+B[i],i));
  }
  int ans=0;
  rep(i,0,N){
    int X=Q.top().first,Y=Q.top().second;
    Q.pop();
    if(i%2==0) ans+=A[Y];
    else ans-=B[Y];
  }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: no matching function for call to 'std::priority_queue<std::pair<std::pair<long long int, long long int>, long long int> >::push(std::pair<long long int, long long int>)'
   25 |     Q.push(mp(A[i]+B[i],i));
      |     ~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<std::pair<long long int, long long int>, long long int>; _Sequence = std::vector<std::pair<std::pair<long long int, long long int>, long long int>, std::allocator<std::pair<std::pair<long long int, long long int>, long long int> > >; _Compare = std::less<std::pair<std::pair<long long int, long long int>, long long int> >; value_type = std::pair<std::pair<long long int, long long int>, long long int>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'const std::priority_queue<std::pair<std::pair<long long int, long long int>, long long int> >::value_type&' {aka 'const std::pair<std::pair<long long int, long long int>, long long int>&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<std::pair<long long int, long long int>, long long int>; _Sequence = std::vector<std::pair<std::pair<long long int, long long int>, long long int>, std::allocator<std::pair<std::pair<long long int, long long int>, long long int> > >; _Compare = std::less<std::pair<std::pair<long long int, long long int>, long long int> >; value_type = std::pair<std::pair<long long int, long long int>, long long int>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from 'std::pair<long long int, long long int>' to 'std::priority_queue<std::pair<std::pair<long long int, long long int>, long long int> >::value_type&&' {aka 'std::pair<std::pair<long long int, long long int>, long long int>&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:29:19: error: cannot convert 'const std::pair<long long int, long long int>' to 'long long int' in initialization
   29 |     int X=Q.top().first,Y=Q.top().second;
      |           ~~~~~~~~^~~~~
      |                   |
      |                   const std::pair<long long int, long long int>