Language: C++

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin>>n;
    ll a[MAX]={};

    for(int i=0;i<3*n;i++){
        cin>>a[i];
    }
    priority_queue<ll,vector<ll>,greater<ll>> aq;

    ll sum=0;

    for(int i=0;i<n;i++){
        aq.push(a[i]);
        sum+=a[i];
    }

    ll ansa[MAX];
    ansa[n-1]=sum;

    for(int i=n;i<2*n;i++){
        aq.push(a[i]);
        sum+=a[i];
        sum-=aq.top();
        aq.pop();
        ansa[i]=sum;
    }

    sum=0;
    ll ansb[MAX];
    priority_queue<ll> bq;

    for(int i=3*n-1;i>=2*n;i--){
        bq.push(a[i]);
        sum+=a[i];
    }

    ansb[2*n]=sum;
    for(int i=2*n-1;i>=n;i--){
        bq.push(a[i]);
        sum += a[i];
        sum -= bq.top();
        bq.pop();
        ansb[i] = sum;
    }


    ll ans =- INF;
    
    for(int i=n-1;i<2*n;i++){
        ans=max(ans,ansa[i]-ansb[i+1]);
    }

    cout<<ans<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:5: error: 'll' was not declared in this scope; did you mean 'LL'?
   46 |     ll a[MAX]={};
      |     ^~
      |     LL
a.cc:49:14: error: 'a' was not declared in this scope
   49 |         cin>>a[i];
      |              ^
a.cc:51:32: error: template argument 2 is invalid
   51 |     priority_queue<ll,vector<ll>,greater<ll>> aq;
      |                                ^
a.cc:51:44: error: template argument 2 is invalid
   51 |     priority_queue<ll,vector<ll>,greater<ll>> aq;
      |                                            ^~
a.cc:51:44: error: template argument 3 is invalid
a.cc:53:7: error: expected ';' before 'sum'
   53 |     ll sum=0;
      |       ^~~~
      |       ;
a.cc:56:12: error: request for member 'push' in 'aq', which is of non-class type 'int'
   56 |         aq.push(a[i]);
      |            ^~~~
a.cc:56:17: error: 'a' was not declared in this scope
   56 |         aq.push(a[i]);
      |                 ^
a.cc:57:9: error: 'sum' was not declared in this scope
   57 |         sum+=a[i];
      |         ^~~
a.cc:60:7: error: expected ';' before 'ansa'
   60 |     ll ansa[MAX];
      |       ^~~~~
      |       ;
a.cc:61:5: error: 'ansa' was not declared in this scope
   61 |     ansa[n-1]=sum;
      |     ^~~~
a.cc:61:15: error: 'sum' was not declared in this scope
   61 |     ansa[n-1]=sum;
      |               ^~~
a.cc:64:12: error: request for member 'push' in 'aq', which is of non-class type 'int'
   64 |         aq.push(a[i]);
      |            ^~~~
a.cc:64:17: error: 'a' was not declared in this scope
   64 |         aq.push(a[i]);
      |                 ^
a.cc:66:17: error: request for member 'top' in 'aq', which is of non-class type 'int'
   66 |         sum-=aq.top();
      |                 ^~~
a.cc:67:12: error: request for member 'pop' in 'aq', which is of non-class type 'int'
   67 |         aq.pop();
      |            ^~~
a.cc:72:7: error: expected ';' before 'ansb'
   72 |     ll ansb[MAX];
      |       ^~~~~
      |       ;
a.cc:73:22: error: template argument 2 is invalid
   73 |     priority_queue<ll> bq;
      |                      ^
a.cc:73:22: error: template argument 3 is invalid
a.cc:76:12: error: request for member 'push' in 'bq', which is of non-class type 'int'
   76 |         bq.push(a[i]);
      |            ^~~~
a.cc:76:17: error: 'a' was not declared in this scope
   76 |         bq.push(a[i]);
      |                 ^
a.cc:80:5: error: 'ansb' was not declared in this scope
   80 |     ansb[2*n]=sum;
      |     ^~~~
a.cc:82:12: error: request for member 'push' in 'bq', which is of non-class type 'int'
   82 |         bq.push(a[i]);
      |            ^~~~
a.cc:82:17: error: 'a' was not declared in this scope
   82 |         bq.push(a[i]);
      |                 ^
a.cc:84:19: error: request for member 'top' in 'bq', which is of non-class type 'int'
   84 |         sum -= bq.top();
      |                   ^~~
a.cc:85:12: error: request for member 'pop' in 'bq', which is of non-class type 'int'
   85 |         bq.pop();
      |            ^~~
a.cc:90:7: error: expected ';' before 'ans'
   90 |     ll ans =- INF;
      |       ^~~~
      |       ;
a.cc:93:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   93 |         ans=max(ans,ansa[i]-ansb[i+1]);
      |         ^~~
      |         abs
a.cc:96:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   96 |     cout<<ans<<endl;
      |           ^~~
      |           abs