Language: C++

include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef priority_queue <ll> pq;
typedef priority_queue <ll, vector<ll>, greater<ll> > rpq;

int main(){
        int N;
        cin>>N;
        rpq a1;
        pq a2;
        vector <ll> a;
        for(int i=0;i<3*N;i++){
                ll aa;
                cin>>aa;
                a.push_back(aa);
        }
        ll sum1[10001]={0}, sum2[10001]={0};
        for(int i=0;i<N;i++){
                a1.push(a[i]);
                sum1[0]+=a[i];
        }
        for(int i=2*N;i<3*N;i++){
                a2.push(a[i]);
                sum2[N]+=a[i];
        }

        for(int i=N;i<2*N;i++){
                sum1[i-N+1]=sum1[i-N];

                sum1[i-N+1]-=a1.top();
                sum1[i-N+1]+=a[i];
                a1.pop();
                a1.push(a[i]);
        }
        for(int i=2*N-1;i>=N;i--){
                sum2[i-N]=sum2[i-N+1];

                sum2[i-N]-=a2.top();
                sum2[i-N]+=a[i];
                a2.pop();
                a2.push(a[i]);
        }
        ll res=-1;
        for(int i=1;i<N;i++){
                //cout<<sum1[i]<<":"<<sum2[i]<<endl;
                res=max(sum1[i]-sum2[i], res);
        }
        cout<<res<<endl;
        return 0;
}
~                                             

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:6:9: error: 'priority_queue' does not name a type
    6 | typedef priority_queue <ll> pq;
      |         ^~~~~~~~~~~~~~
a.cc:7:9: error: 'priority_queue' does not name a type
    7 | typedef priority_queue <ll, vector<ll>, greater<ll> > rpq;
      |         ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin>>N;
      |         ^~~
a.cc:12:9: error: 'rpq' was not declared in this scope
   12 |         rpq a1;
      |         ^~~
a.cc:13:9: error: 'pq' was not declared in this scope
   13 |         pq a2;
      |         ^~
a.cc:14:9: error: 'vector' was not declared in this scope
   14 |         vector <ll> a;
      |         ^~~~~~
a.cc:14:19: error: expected primary-expression before '>' token
   14 |         vector <ll> a;
      |                   ^
a.cc:14:21: error: 'a' was not declared in this scope
   14 |         vector <ll> a;
      |                     ^
a.cc:22:17: error: 'a1' was not declared in this scope
   22 |                 a1.push(a[i]);
      |                 ^~
a.cc:26:17: error: 'a2' was not declared in this scope
   26 |                 a2.push(a[i]);
      |                 ^~
a.cc:33:30: error: 'a1' was not declared in this scope
   33 |                 sum1[i-N+1]-=a1.top();
      |                              ^~
a.cc:41:28: error: 'a2' was not declared in this scope
   41 |                 sum2[i-N]-=a2.top();
      |                            ^~
a.cc:49:21: error: 'max' was not declared in this scope
   49 |                 res=max(sum1[i]-sum2[i], res);
      |                     ^~~
a.cc:51:9: error: 'cout' was not declared in this scope
   51 |         cout<<res<<endl;
      |         ^~~~
a.cc:51:20: error: 'endl' was not declared in this scope
   51 |         cout<<res<<endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:54:2: error: expected class-name at end of input
   54 | ~
      |  ^