criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <map>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll Inf = 1 << 30;
const int maxx = 1e3 + 8;
priority_queue <ll> qua;
priority_queue <ll, vector<ll>, greater<ll> > que;
int n;
ll a[maxx * 3];
ll suml[maxx / 2], sumr[maxx / 2];
ll s1, s2;
map <ll, bool> vis;

int main() {
	/*ll ss[6] = {0, 2, 4, 5, 3, 1};
	for(int i = 1; i <= 5; i++) que.push(ss[i]);
	while(!que.empty()) {
		cout << que.top() << endl;
		que.pop(); //1 2 3 4 5
		//qua.pop(); //5 4 3 2 1
	}*/
	vis.clear();
	scanf("%d", &n);
	for(int i = 1; i <= n * 3; i++) {
		scanf("%I64d", &a[i]);
		if(i <= n) {
			s1 += a[i];
			que.push(a[i]);
		}
		else if(i >= 2 * n + 1) {
			s2 += a[i];
			qua.push(a[i]);
		}
	}
	int L = n, R = 2 * n + 1;
	suml[L] = s1, sumr[R] = s2;
	for(int i = n + 1; i <= n * 2; i++) {
		if(a[i] > que.top()) {
			vis[a[i]] = 1;
			s1 -= que.top();
			s1 += a[i];
			que.pop();
			que.push(a[i]);
			suml[i] = s1;
		}
	}
	int tmpsum = s2;
	for(int i = n * 2; i >= n + 1; i--) {
		if(a[i] < qua.top()) {
			if(vis[a[i]]) {
				sumr[i] = tmpsum;
				continue;
			}
			s2 -= qua.top();
			s2 += a[i];
			qua.pop();
			qua.push(a[i]);
			sumr[i] = s2;
		}
	}
	ll ans = -Inf;
	/*for(int i = n + 1; i <= n * 2; i++) {
		cout << suml[i] << " " << sumr[i] << endl;
	}*/
	for(int i = n + 1; i <= n * 2; i++) ans = max(ans, suml[i] - sumr[i]);
	cout << ans << endl;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<stack>
#define FAST ios::sync_with_stdio(false)
#define lowbit(x) x&(-x)
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e5 + 5;
using namespace std;

priority_queue <ll, vector<ll>, greater<ll> > q1;//小的在前
priority_queue <ll> q2;//大的在前

ll a[maxn * 3];
ll l[maxn * 3], r[maxn * 3];//维护l最大,r最小

int main()
{
	int n; scanf("%d", &n);
	for(int i = 1; i <= 3 * n; i++){
		scanf("%lld", &a[i]);
	}
	ll sum = 0;
	for(int i = 1; i <= 3 * n; i++){
		q1.push(a[i]);
		sum += a[i], l[i] = sum;
		if(q1.size() > n){
			sum -= q1.top();
			q1.pop();
			l[i] = sum;
		}
	}
//---------------------------------------
	sum = 0;
	for(int i = 3 * n; i >= 1; i--){
		q2.push(a[i]);
		sum += a[i], r[i] = sum;
		if(q2.size() > n){
			sum -= q2.top();
			q2.pop();
			r[i] = sum;
		}
	}
	ll ans = -inf;
	for(int i = n; i <= 2 * n; i++){
		ans = max(ans, l[i] - r[i+1]);//left - right
	}
	printf("%lld\n", ans);
	return 0;
}

/*int sum(int x){
	int ret = 0;
	for( ; x > 0; ret += c[x], x -= lowbit(x));
	return ret;
}

void update(int x, int val){
	for ( ; x <= n; c[x] += val, x += lowbit(x));
}

Compiler output:
a.cc:63:1: error: unterminated comment
   63 | /*int sum(int x){
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<stack>
#define FAST ios::sync_with_stdio(false)
#define lowbit(x) x&(-x)
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e5 + 5;
using namespace std;

priority_queue <int, vector<int>, greater<int> > q1;//小的在前
priority_queue <int> q2;//大的在前

int a[maxn];
ll l[maxn], r[maxn];//维护l最大,r最小

int main()
{
	int n; scanf("%d", &n);
	for(int i = 1; i <= 3 * n; i++){
		scanf("%d", &a[i]);
	}
	ll sum = 0;
	for(int i = 1; i <= 3 * n; i++){
		q1.push(a[i]);
		sum += a[i], l[i] = sum;
		if(q1.size() > n){
			sum -= q1.top();
			q1.pop();
			l[i] = sum;
		}
	}
//---------------------------------------
	sum = 0;
	for(int i = 3 * n; i >= 1; i--){
		q2.push(a[i]);
		sum += a[i], r[i] = sum;
		if(q2.size() > n){
			sum -= q2.top();
			q2.pop();
			r[i] = sum;
		}
	}
	ll ans = -inf;
	for(int i = n; i <= 2 * n; i++){
		ans = max(ans, l[i] - r[i+1]);//left - right
	}
	printf("%lld\n", ans);
	return 0;
}

/*int sum(int x){
	int ret = 0;
	for( ; x > 0; ret += c[x], x -= lowbit(x));
	return ret;
}

void update(int x, int val){
	for ( ; x <= n; c[x] += val, x += lowbit(x));
}

Compiler output:
a.cc:63:1: error: unterminated comment
   63 | /*int sum(int x){
      | ^
Language: C++

#include <stdio.h>
#include <queue>
#include <algorithm>

using namespace std;

#define REP(a, i, n) for (int i = a; i < n; ++i)
#define RREP(n, i, a) for (int i = n - 1; i >= a; --i)

int main() {
    int N;
    scanf("%d", &N);

    int _3N = 3 * N;
    int a[_3N];
    REP(0, i, _3N) {
        scanf("%d", &a[i]);
    }

    // Red
    priority_queue<int, vector<int>, greater<int> > red_q;
    long red_sum = 0;
    REP(0, i, N) {
        red_q.push(a[i]);
        red_sum += a[i];
    }
    long red_sum_v[_3N];
    red_sum_v[N - 1] = red_sum;

    int _2N = 2 * N;
    REP(N, i, _2N) {
        long ai = a[i];
        long red_t = red_q.top();
        if (ai > red_t) {
            red_q.pop();
            red_q.push(ai);
            red_sum += ai - red_t;
        }
        red_sum_v[i] = red_sum;
    }

    // Blue
    priority_queue<int> blue_q;
    long blue_sum = 0;
    REP(_2N, i, _3N) {
        blue_q.push(a[i]);
        blue_sum += a[i];
    }
    long blue_sum_v[_3N];
    blue_sum_v[_2N] = blue_sum;

    RREP(_2N, i, N) {
        long ai = a[i];
        long blue_t = blue_q.top();
        if (ai < blue_t) {
            blue_q.pop();
            blue_q.push(ai);
            blue_sum += ai - blue_t;
        }
        blue_sum_v[i] = blue_sum;
    }

    long ans = LONG_MIN;
    REP(N, i, _2N + 1) {
        // printf("%ld - %ld = %ld\n", red_sum_v[i - 1], blue_sum_v[i], red_sum_v[i - 1] - blue_sum_v[i]);
        ans = max(ans, red_sum_v[i - 1] - blue_sum_v[i]);
    }

    printf("%ld\n", ans);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:16: error: 'LONG_MIN' was not declared in this scope
   63 |     long ans = LONG_MIN;
      |                ^~~~~~~~
a.cc:4:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 |
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  priority_queue<int, vector<int>, greater<int> > gq;
  priority_queue<int> lq;
  vector<int> mid(n);
  vector<ll> sumf(n + 1), sums(n + 1);
  int sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    gq.push(a);
    sum1 += a;
  }
  for (int i = 0; i < n; i++) {
    cin >> mid[i];
  }
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    lq.push(a);
    sum2 += a;
  }
  sumf[0] = sum1;
  for (int i = 0; i < n; i++) {
    gq.push(mid[i]);
    sumf[i + 1] = sumf[i] + mid[i] - gq.top();
    gq.pop();
  }
  sums[n] = sum2;
  for (int i = n - 1; i >= 0; i--) {
    lq.push(mid[i]);
    sums[i] = sums[i + 1] + mid[i] - lq.top();
    lq.pop();
  }
  ll answer = sumf[n] - sums[n];
  for (int i = 0; i < n; i++) {
    if (answer < sumf[i] - sums[i]) {
      answer = sumf[i] - sums[i];
    }
  }
  cout << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'll' was not declared in this scope; did you mean 'lq'?
   11 |   vector<ll> sumf(n + 1), sums(n + 1);
      |          ^~
      |          lq
a.cc:11:12: error: template argument 1 is invalid
   11 |   vector<ll> sumf(n + 1), sums(n + 1);
      |            ^
a.cc:11:12: error: template argument 2 is invalid
a.cc:28:7: error: invalid types 'int[int]' for array subscript
   28 |   sumf[0] = sum1;
      |       ^
a.cc:31:9: error: invalid types 'int[int]' for array subscript
   31 |     sumf[i + 1] = sumf[i] + mid[i] - gq.top();
      |         ^
a.cc:31:23: error: invalid types 'int[int]' for array subscript
   31 |     sumf[i + 1] = sumf[i] + mid[i] - gq.top();
      |                       ^
a.cc:34:7: error: invalid types 'int[int]' for array subscript
   34 |   sums[n] = sum2;
      |       ^
a.cc:37:9: error: invalid types 'int[int]' for array subscript
   37 |     sums[i] = sums[i + 1] + mid[i] - lq.top();
      |         ^
a.cc:37:19: error: invalid types 'int[int]' for array subscript
   37 |     sums[i] = sums[i + 1] + mid[i] - lq.top();
      |                   ^
a.cc:40:5: error: expected ';' before 'answer'
   40 |   ll answer = sumf[n] - sums[n];
      |     ^~~~~~~
      |     ;
a.cc:42:9: error: 'answer' was not declared in this scope
   42 |     if (answer < sumf[i] - sums[i]) {
      |         ^~~~~~
a.cc:42:22: error: invalid types 'int[int]' for array subscript
   42 |     if (answer < sumf[i] - sums[i]) {
      |                      ^
a.cc:42:32: error: invalid types 'int[int]' for array subscript
   42 |     if (answer < sumf[i] - sums[i]) {
      |                                ^
a.cc:43:20: error: invalid types 'int[int]' for array subscript
   43 |       answer = sumf[i] - sums[i];
      |                    ^
a.cc:43:30: error: invalid types 'int[int]' for array subscript
   43 |       answer = sumf[i] - sums[i];
      |                              ^
a.cc:46:11: error: 'answer' was not declared in this scope
   46 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <numeric>
#include <iostream>

using namespace std;

#define FOR(i, a, b)   for(int i = (a); i < (b); i++)
#define RFOR(i, a, b)  for(int i = (a); i > (b); i--)
#define rep(i, n)	   for(int i = 0; i < (n); i++)
#define all(c)		   begin(c), end(c)
#define rall(c)		   rbegin(c), rend(c)
#define foritr(itr, c) for(auto itr = begin(c); itr != end(c); itr++)
#define SZ(a)		   ((ll) a.size())

typedef long long int		   ll;
typedef long long unsigned int llu;

void solve(ll N, vector <ll> a) {
	ll mae[N + 1]	= { };
	ll usiro[N + 1] = { };
	vector <ll> tmpcopy(3 * N);
	vector <ll> rev(3 * N);
	copy(all(a), begin(rev));
	reverse(all(rev));
	rep(i, N + 1) {
		copy(all(a), begin(tmpcopy));
		sort(begin(tmpcopy), begin(tmpcopy) + N + i, greater <ll>());
		mae[i] = accumulate(begin(tmpcopy), begin(tmpcopy) + N, 0);
	}
	rep(i, N + 1) {
		copy(all(rev), begin(tmpcopy));
		sort(begin(tmpcopy), begin(tmpcopy) + N + i);
		usiro[i] = accumulate(begin(tmpcopy), begin(tmpcopy) + N, 0);
	}

	ll tmp = LLONG_MIN;
	rep(i, N + 1) {
		if(mae[i] - usiro[N - i] > tmp) tmp = mae[i] - usiro[N - i];
	}
	printf("%lld", tmp);
}

int main() {
	ll N;
	scanf("%lld", &N);
	vector <ll> a(3 * N - 1 + 1);
	for(int i = 0; i <= 3 * N - 1; i++) {
		scanf("%lld", &a[i]);
	}
	solve(N, a);
	return 0;
}


Compiler output:
a.cc: In function 'void solve(ll, std::vector<long long int>)':
a.cc:45:18: error: 'LLONG_MIN' was not declared in this scope
   45 |         ll tmp = LLONG_MIN;
      |                  ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <iostream>
  +++ |+#include <climits>
   13 |
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main(void){
    ll N;
    cin >> N;
    vector<ll> v(3*N);
    for(auto& it : v) cin >> it;

    ll ans = -1e20;

    for(ll t=N; t<=2*N-1;t++){
        priority_queue<ll, less> left;
        priority_queue<ll, greater> right;
        
        for(ll i=0;i<t;i++) {
            left.push(v[i]);
        }
        for(ll i=t; i<3*N; i++) {
            right.push(v[i]);
        }

        ll tl=0,tr=0;
        
        for(ll i=0;i<N;i++){
            tl += left.top(); left.pop();
            tr += right.top(); right.pop();
        }

        ans = max(ans, tl - tr);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '-1.0e+20' to '-9223372036854775808' [-Woverflow]
   12 |     ll ans = -1e20;
      |              ^~~~~
a.cc:15:32: error: type/value mismatch at argument 2 in template parameter list for 'template<class _Tp, class _Sequence, class _Compare> class std::priority_queue'
   15 |         priority_queue<ll, less> left;
      |                                ^
a.cc:15:32: note:   expected a type, got 'less'
a.cc:15:32: error: template argument 3 is invalid
a.cc:16:35: error: type/value mismatch at argument 2 in template parameter list for 'template<class _Tp, class _Sequence, class _Compare> class std::priority_queue'
   16 |         priority_queue<ll, greater> right;
      |                                   ^
a.cc:16:35: note:   expected a type, got 'greater'
a.cc:16:35: error: template argument 3 is invalid
a.cc:19:18: error: request for member 'push' in 'left', which is of non-class type 'int'
   19 |             left.push(v[i]);
      |                  ^~~~
a.cc:22:19: error: request for member 'push' in 'right', which is of non-class type 'int'
   22 |             right.push(v[i]);
      |                   ^~~~
a.cc:28:24: error: request for member 'top' in 'left', which is of non-class type 'int'
   28 |             tl += left.top(); left.pop();
      |                        ^~~
a.cc:28:36: error: request for member 'pop' in 'left', which is of non-class type 'int'
   28 |             tl += left.top(); left.pop();
      |                                    ^~~
a.cc:29:25: error: request for member 'top' in 'right', which is of non-class type 'int'
   29 |             tr += right.top(); right.pop();
      |                         ^~~
a.cc:29:38: error: request for member 'pop' in 'right', which is of non-class type 'int'
   29 |             tr += right.top(); right.pop();
      |                                      ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <map>
#include <set>
#include <iomanip>
#include <cmath>

using namespace std;

typedef long long int ll;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF=1LL<<60;

vector<string> split(const string& input, char delimiter)
{
    stringstream stream(input);
    
    string field;
    vector<string> result;
    while (getline(stream, field, delimiter)) {
        result.push_back(field);
    }
    return result;
}
 
//#define DEBUG

ll A, B, M, N, D, K, L, Q, W, H, T, X, Y, S;

int main()
{
    cin >> N;
    vector<ll> nums(3*N);
    for (auto &n : nums)
        cin >> n;

    if (N == 1) {
        cout << max( nums[0] - min(nums[1], nums[2]),
                     max(nums[0], nums[1]) - nums[2] ) << endl;
        return 0;
    }
    
    vector<ll> former(nums.begin(), nums.begin()+N);
    
    ll fSum = accumulate(former.begin(), former.end(), 0);
    priority_queue< ll, vector<ll>, greater<ll> > fpq;
    for (auto l : former)
        fpq.push(l);

    ll maxScore = INT64_MIN;

    vector<ll>::iterator nItr = nums.begin()+N;
    
    for (int i = N; i < 2*N; ++i) {
        ll f = *(nItr);
        fpq.push(f);
        fSum += f - fpq.top();
        fpq.pop();

        cerr << endl << "step" << i << " " << fpq.size() << " " << fpq.top() << endl;
        cerr << "fsum : " << fSum << endl;
        
        vector<ll> latter(nums.rbegin(), nums.rbegin()+2*N-i+1);
        for (auto l : latter)
            cerr << " " << l;
        cerr << "<= latter" << endl;
        priority_queue<ll> lpq(less<ll>(), latter);
        ll lSum = accumulate(latter.begin(), latter.begin()+N, 0);
        auto lItr = latter.begin()+N;
        for (int j = 0; lItr < latter.end(); ++j) {
            ll l = *(lItr);
            lpq.push(l);
            lSum += l - lpq.top();
            cerr << j << " : " << f << " " << l << endl;

            cerr << "lSum : " << lSum << endl;
            lpq.pop();
            maxScore = max(maxScore, fSum - lSum);
            lItr++;
        }
        maxScore = max(maxScore, fSum-lSum);

        nItr++;
        //cerr << endl;
    }
    cout << maxScore << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:15: error: 'accumulate' was not declared in this scope
   50 |     ll fSum = accumulate(former.begin(), former.end(), 0);
      |               ^~~~~~~~~~
a.cc:55:19: error: 'INT64_MIN' was not declared in this scope
   55 |     ll maxScore = INT64_MIN;
      |                   ^~~~~~~~~
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> > pqr;

int main(){
        int N;
        cin>>N;
        vector <ll> a;
        pqr frt;
        pq bak;
        for(int i=0;i<3*N;i++){
                ll aa;
                cin>>aa;
                a.push_back(aa);
        }
        ll sum1[111111]={0}, sum2[111111]={0};
        for(int i=0;i<N;i++){
                frt.push(a[i]);
                sum1[0]+=a[i];
        }
        for(int i=2*N;i<3*N;i++){
                bak.push(a[i]);
                sum2[N]+=a[i];
        }
        for(int i=N;i<2*N;i++){
                sum1[i-N+1]=sum1[i-N];
                ll e=frt.top();
                frt.pop();
                sum1[i-N+1]-=e;
                sum1[i-N+1]+=a[i];
                frt.push(a[i]);
        }
        for(int i=2*N-1;i>=N;i--){
                sum2[i-N]=sum2[i-N+1];
                ll e=bak.top();
                bak.pop();
                sum2[i-N]-=e;
                sum2[i-N]+=a[i];
                bak.push(a[i]);
        }
        for(int i=0;i<i=N;i++){
                if(sum1[i]>sum1[i+1]){
                        sum1[i+1]=sum1[i];
                }
                if(sum2[i]>sum2[i+1]){
                        sum2[i]=sum2[i+1];
                }
        }
        ll res=-1111111111111111111;
        for(int i=0;i<=N;i++){
                res=max(res, sum1[i]-sum2[i]);
        }
        cout<<res<<endl;
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:22: error: lvalue required as left operand of assignment
   45 |         for(int i=0;i<i=N;i++){
      |                     ~^~
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[100100]={0}, sum2[100100]={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=-1111111111111111111;
        for(int i=0;i<=N;i++){
                //cout<<sum1[i]<<":"<<sum2[i]<<endl;
                res=max(sum1[i]-sum2[j], res);
        }
        cout<<res<<endl;
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:38: error: 'j' was not declared in this scope
   49 |                 res=max(sum1[i]-sum2[j], res);
      |                                      ^
Language: C++

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<queue>
#include<climits>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<long long> a(3*N);
	for(int i=0; i<3*N; i++)
		cin >> a[i];

	vector<long long> f_table(N+1, 0);
	long long sum = 0;
	priority_queue<long long> que;
	for(int i=0; i<N; i++)
	{
		sum += a[i];
		que.push(-a[i]);
	}
	f_table[0] = sum;
	for(int i=0; i<N; i++)
	{
		int index = N + i;
		sum += a[index];
		que.push(-a[index]);
		sum += que.top();
		que.pop();

		f_table[i + 1] = sum;
	}
	
	sum = 0;
	que.swap(priority_queue<long long int>());
	vector<long long> b_table(N+1);
	for(int i=0; i<N; i++)
	{
		int index = 3*N-1 - i;
		sum += a[index];
		que.push(a[index]);
	}
	b_table[0] = sum;
	for(int i=0; i<N; i++)
	{
		int index = 2*N-1 - i;
		sum += a[index];
		que.push(a[index]);
		sum -= que.top();
		que.pop();

		b_table[i + 1] = sum;
	}

	long long ret = LLONG_MIN;
	for(int i=N; i<=2*N; i++)
	{
		ret = max(ret, f_table[i-N]-b_table[2*N-i]);
	}
	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:18: error: cannot bind non-const lvalue reference of type 'std::priority_queue<long long int>&' to an rvalue of type 'std::priority_queue<long long int>'
   39 |         que.swap(priority_queue<long long int>());
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_queue.h:780:28: note:   initializing argument 1 of 'void std::priority_queue<_Tp, _Sequence, _Compare>::swap(std::priority_queue<_Tp, _Sequence, _Compare>&) [with _Tp = long long int; _Sequence = std::vector<long long int>; _Compare = std::less<long long int>]'
  780 |       swap(priority_queue& __pq)
      |            ~~~~~~~~~~~~~~~~^~~~
Language: C++

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<queue>
#include<climits>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<long long> a(3*N);
	for(int i=0; i<3*N; i++)
		cin >> a[i];

	vector<long long> f_table(N+1, 0);
	long long sum = 0;
	priority_queue<long long> que;
	for(int i=0; i<N; i++)
	{
		sum += a[i];
		que.push(-a[i]);
	}
	f_table[0] = sum;
	for(int i=0; i<N; i++)
	{
		int index = N + i;
		sum += a[index];
		que.push(-a[index]);
		sum += que.top();
		que.pop();

		f_table[i + 1] = sum;
	}
	
	sum = 0;
	que.swap(priority_queue<long long>());
	vector<long long> b_table(N+1);
	for(int i=0; i<N; i++)
	{
		int index = 3*N-1 - i;
		sum += a[index];
		que.push(a[index]);
	}
	b_table[0] = sum;
	for(int i=0; i<N; i++)
	{
		int index = 2*N-1 - i;
		sum += a[index];
		que.push(a[index]);
		sum -= que.top();
		que.pop();

		b_table[i + 1] = sum;
	}

	long long ret = LLONG_MIN;
	for(int i=N; i<=2*N; i++)
	{
		ret = max(ret, f_table[i-N]-b_table[2*N-i]);
	}
	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:18: error: cannot bind non-const lvalue reference of type 'std::priority_queue<long long int>&' to an rvalue of type 'std::priority_queue<long long int>'
   39 |         que.swap(priority_queue<long long>());
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_queue.h:780:28: note:   initializing argument 1 of 'void std::priority_queue<_Tp, _Sequence, _Compare>::swap(std::priority_queue<_Tp, _Sequence, _Compare>&) [with _Tp = long long int; _Sequence = std::vector<long long int>; _Compare = std::less<long long int>]'
  780 |       swap(priority_queue& __pq)
      |            ~~~~~~~~~~~~~~~~^~~~
Language: C++


#include <iostream>
#include <algorithm>


int main()
{
	int N;
	long long min = LONG_MIN;
	std::cin >> N;
	 unsigned long aa[30010];
	 unsigned long a[30010];
	 unsigned long aaa[30010];
	
	
	for (int i = 0; i < 3*N; ++i)
	{
		std::cin >> aa[i];
	}

	for (int i = 0; i < N; ++i)
	{
		for (int j = 0; j < 3*N; ++j)
		{
			a[j] = aa[j];
		}
		for (int j = 0; j < 3 * N; ++j)
		{
			aaa[j] = aa[j];
		}
		long long sum = 0;
		std::sort(a, a + N+i);
		for (int j = 0; j < N; ++j)
		{
			sum+= a[N+i -1- j];
		}
		
		std::sort(aaa+ N + i, aaa+3*N );
		for (int j = N+i; j < 2*N+i; ++j)
		{
			sum-= aaa[j];
		}
		if (sum > min)min = sum;
	}

	std::cout << min;
	



    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: 'LONG_MIN' was not declared in this scope
    9 |         long long min = LONG_MIN;
      |                         ^~~~~~~~
a.cc:4:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 |
Language: C++

#include "stdafx.h"
#include <iostream>
#include <algorithm>


int main()
{
	int N;
	long min = LONG_MIN;
	std::cin >> N;
	int aa[30010];
	int a[30010];
	int aaa[30010];
	
	for (int i = 0; i < 3*N; ++i)
	{
		std::cin >> aa[i];
	}

	for (int i = 0; i < N; ++i)
	{
		for (int j = 0; j < 3*N; ++j)
		{
			a[j] = aa[j];
		}
		for (int j = 0; j < 3 * N; ++j)
		{
			aaa[j] = aa[j];
		}
		int sum = 0;
		std::sort(a, a + N+i);
		for (int j = 0; j < N; ++j)
		{
			sum+= a[N+i -1- j];
		}
		
		std::sort(aaa+ N + i, aaa+3*N );
		for (int j = N+i; j < 2*N+i; ++j)
		{
			sum-= aaa[j];
		}
		if (sum > min)min = sum;
	}

	std::cout << min;
	



    return 0;
}



Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <queue>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define pq priority_queue
#define FOR(i,a,b) for (long i=(a);i<(b);i++)
#define RFOR(i,a,b) for (long i=(b)-1;i>=(a);i--)
#define REP(i,n) for (long i=0;i<(n);i++)
#define RREP(i,n) for (long i=(n)-1;i>=0;i--)

#define MIN 2147483648

#define ALL(a) (a).begin(),a.end()
#define MAXE(a) *max_element(ALL(a))
#define MINE(a) *min_element(ALL(a))

int main(){
	long long N;
	cin >> N;
	long long a[300001];

	REP(i,3*N) {
		cin >> a[i];
		if(a[i]>950000000){
			exit(1);
		}
	}
	cout << 0 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:40:27: error: expected '}' at end of input
   40 |         cout << 0 << endl;
      |                           ^
a.cc:29:11: note: to match this '{'
   29 | int main(){
      |           ^
Language: C++

#include <cstdio>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <queue>
using namespace std;

typedef vector<int> vi;
#define pq priority_queue
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define ALL(a) (a).begin(),a.end()
#define MAXE(a) *max_element(ALL(a))
#define MINE(a) *min_element(ALL(a))

int main(){
	int N;
	cin >> N;
	int a[300000];

	REP(i,3*N) cin >> a[i];
	pq <int,vi,greater<int> > left;
	pq <int> right;
	
	long out = LONG_MIN;
	long t = 0;

	FOR(k,N,2*N){
		t = 0;
		REP(i,N) left.push(a[i]);
		FOR(i,2*N,3*N) right.push(a[i]);

		FOR(i,N,k){
			left.push(a[i]);
			left.pop();//leftから最小のものをpopする
		}
		FOR(i,k,2*N){
			right.push(a[i]);
			right.pop();//rightから最大のものをpopする
		}

		REP(i,N){
			t += left.top() - right.top();
			left.pop();
			right.pop();
		}


		out = max(t,out);

	}	


	cout << out << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: 'LONG_MIN' was not declared in this scope
   31 |         long out = LONG_MIN;
      |                    ^~~~~~~~
a.cc:9:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <queue>
  +++ |+#include <climits>
    9 | using namespace std;
Language: C++

#innclude <iostream>
#include <queue>
#include <vector>

using namespace std;

vector<int> midN;

priority_queue<int, vector<int>, greater<int>> leftN;

priority_queue<int> rightN;

vector<long> savedLeft;
vector<long> savedRight;

int main(){
  int N=0;
  cin>>N;
  int head=0;
  int tail=N-1;
  long sumLeft=0;
  long sumRight=0;
  long res=0;
  
  for(int i=0;i<N;i++){
    int tmp;
    cin>>tmp;
    leftN.push(tmp);
    sumLeft+=tmp;
  }

  for(int i=0;i<N;i++){
    int tmp;
    cin>>tmp;
    midN.push_back(tmp);
  }

  for(int i=0;i<N;i++){
    int tmp;
    cin>>tmp;
    rightN.push(tmp);
    sumRight+=tmp;
  }

  res=sumLeft-sumRight;
  sumLeft=sumRight=0;
  savedLeft.push_back(sumLeft);
  savedRight.push_back(sumRight);
  
  for(int i=0;i<N;i++){
    int opA=midN[i]-leftN.top();
    if(opA>0){
      leftN.pop();
      leftN.push(midN[i]);
      sumLeft+=opA;
    }
    savedLeft.push_back(sumLeft);
  }

  for(int i=N-1;i>=0;i--){
    int opB=rightN.top()-midN[i];
    if(opB>0){
      rightN.pop();
      rightN.push(midN[i]);
      sumRight+=opB;
    }
    savedRight.push_back(sumRight);
  }
  
  long maxSum=0;
  for(int i=0;i<=N;i++){
    long tmp=savedLeft[i]+savedRight[N-i];
    if(tmp>maxSum)
      maxSum=tmp;
  }

  cout<<res+maxSum<<endl;
  
  return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #innclude; did you mean #include?
    1 | #innclude <iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:18:3: error: 'cin' was not declared in this scope
   18 |   cin>>N;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <queue>
  +++ |+#include <iostream>
    3 | #include <vector>
a.cc:77:3: error: 'cout' was not declared in this scope
   77 |   cout<<res+maxSum<<endl;
      |   ^~~~
a.cc:77:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:77:21: error: 'endl' was not declared in this scope
   77 |   cout<<res+maxSum<<endl;
      |                     ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <queue>
  +++ |+#include <ostream>
    3 | #include <vector>
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <vector>
#include <queue>
#include <stdio.h>
#include <functional>
#define int long long
using namespace std;
 
signed main(){
    int n;
    int max=0;
    int min=0;
    cin>> n;
    int N=3*n;
    int a[N];
 
    priority_queue<int> PQ1;
    priority_queue<int, vector<int>, greater<int> >PQ2;
 
    int max_arr[n+2]={0};
    int min_arr[n+2]={0};
    
    for(int i=0;i<3*n;i++){
        cin>>a[i];
        
    }
 
    for(int i=0;i<n;i++){
        max+=a[i];
        min+=a[i+2*n];
    }
 
    // cout<<max<<" "<<min<<endl;
 
    max_arr[0]=max;
    
    for(int i=0;i<n;i++){
        PQ2.push(a[i]);
    }
 
    for(int i=n;i<2*n+1;i++){
        PQ2.push(a[i]);
        max+=a[i];
        max-=PQ2.top();
        PQ2.pop();
        max_arr[i-n+1]=max;
 
    }
 
    // for(int i=0;i<n+1;i++){
    //     cout<<max_arr[i]<<" ";
    // }
 
    min_arr[n]=min;
    for(int i=2*n;i<3*n;i++){
        PQ1.push(a[i]);
    }
    for(int i=3*n;i>2*n;i--){
        // cout<<i-n-1<<endl;
        PQ1.push(a[i-n-1]);
        min+=a[i-n-1];
        min-=PQ1.top();
 
        // cout<<PQ1.top()<<endl;
        PQ1.pop();
        min_arr[(i-2*n)-1]=min;
    }
    // cout<<count<<endl;
 
 
    // for(int i=0;i<n+1;i++){
    //     cout<<min_arr[i]<<" ";
    // }
 
 
    // for(int i=0;i<n+1;i++){
    //     max[i]=
    // }
 
    long long int ans=-1e19;
    for(int i=0;i<n+1;i++){
        if(ans<max_arr[i]-min_arr[i]){
            ans=max_arr[i]-min_arr[i];
        }
        // ans=max(ans,);
    }
    // cout<<ans<<endl;
    
 
    cout<<ans<<endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'long long long' is too long for GCC
    8 | #define int long long
      |             ^~~~
a.cc:82:15: note: in expansion of macro 'int'
   82 |     long long int ans=-1e19;
      |               ^~~
a.cc:8:18: error: 'long long long' is too long for GCC
    8 | #define int long long
      |                  ^~~~
a.cc:82:15: note: in expansion of macro 'int'
   82 |     long long int ans=-1e19;
      |               ^~~
a.cc:82:23: warning: overflow in conversion from 'double' to 'long long int' changes value from '-1.0e+19' to '-9223372036854775808' [-Woverflow]
   82 |     long long int ans=-1e19;
      |                       ^~~~~
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define LL long long
#define ll long long
#define ULL unsigned long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define sint(x) int x; (void*)scanf("%d",&x);
#define sint2(x,y) int x,y; (void*)scanf("%d %d",&x,&y);
#define lint(x) long long x; (void*)scanf("%lld",&x);
#define vint(v,n) vector<int> v(n); rep(i,n) (void*)scanf("%d", &v[i]);
#define vlint(v,n) vector<lint> v(n); rep(i,n) (void*)scanf("%lld", &v[i]);
#define sdouble(x) double x; (void*)scanf("%lf",&x);
#define vdouble(v,n) vector<double> v(n); rep(i,n) (void*)scanf("%lf", &v[i]);
#define schar(x) char x; (void*)scanf(" %c", &x);
#define sstring(x) string x; cin >> x;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;


#include "Main.h"

int main(int argc, char** argv) {
	sint(N);
	vint(a, 3 * N);
	int min = -2147483647;
	rep(i, N + 1) {
		vector<int> left(N + i), right(2 * N - i), left2(N), right2(N);
		copy(a.begin(), a.begin() + N + i, left.begin());
		sort(all(left));
		copy(a.begin() + N + i, a.end(), right.begin());
		sort(all(right));

		copy(left.begin() + i, left.begin() + i + N, left2.begin());
		copy(right.begin(), right.begin() + N, right2.begin());
		ll score = accumulate(all(left2), (ll)0) - accumulate(all(right2), (ll)0);
		if (min < score) {
			min = score;
		}
	}
	printf("%d\n", min);
}

Compiler output:
a.cc:65:10: fatal error: Main.h: No such file or directory
   65 | #include "Main.h"
      |          ^~~~~~~~
compilation terminated.
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define LL long long
#define ll long long
#define ULL unsigned long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define sint(x) int x; scanf("%d",&x);
#define sint2(x,y) int x,y; scanf("%d %d",&x,&y);
#define lint(x) long long x; scanf("%lld",&x);
#define vint(v,n) vector<int> v(n); rep(i,n) scanf("%d", &v[i]);
#define vlint(v,n) vector<lint> v(n); rep(i,n) scanf("%lld", &v[i]);
#define sdouble(x) double x; scanf("%lf",&x);
#define vdouble(v,n) vector<double> v(n); rep(i,n) scanf("%lf", &v[i]);
#define schar(x) char x; scanf(" %c", &x);
#define sstring(x) string x; cin >> x;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdint>
#include <limits>
using namespace std;


int main(int argc, char** argv) {
	sint(N);
	vint(a, 3 * N);
	int min = INT_MIN;
	rep(i, N + 1) {
		vector<int> left(N + i), right(2 * N - i), left2(N), right2(N);
		copy(a.begin(), a.begin() + N + i, left.begin());
		sort(all(left));
		copy(a.begin() + N + i, a.end(), right.begin());
		sort(all(right));

		copy(left.begin() + i, left.begin() + i + N, left2.begin());
		copy(right.begin(), right.begin() + N, right2.begin());
		int score = accumulate(all(left2), 0) - accumulate(all(right2), 0);
		if (min < score) {
			min = score;
		}
	}
	printf("%d\n", min);
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:70:19: error: 'INT_MIN' was not declared in this scope
   70 |         int min = INT_MIN;
      |                   ^~~~~~~
a.cc:64:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   63 | #include <limits>
  +++ |+#include <climits>
   64 | using namespace std;
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define LL long long
#define ll long long
#define ULL unsigned long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define sint(x) int x; scanf("%d",&x);
#define sint2(x,y) int x,y; scanf("%d %d",&x,&y);
#define lint(x) long long x; scanf("%lld",&x);
#define vint(v,n) vector<int> v(n); rep(i,n) scanf("%d", &v[i]);
#define vlint(v,n) vector<lint> v(n); rep(i,n) scanf("%lld", &v[i]);
#define sdouble(x) double x; scanf("%lf",&x);
#define vdouble(v,n) vector<double> v(n); rep(i,n) scanf("%lf", &v[i]);
#define schar(x) char x; scanf(" %c", &x);
#define sstring(x) string x; cin >> x;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstdint>
#include <limits>
using namespace std;


#include "Main.h"

int main(int argc, char** argv) {
	sint(N);
	vint(a, 3 * N);
	int min = INT_MIN;
	rep(i, N + 1) {
		vector<int> left(N + i), right(2 * N - i), left2(N), right2(N);
		copy(a.begin(), a.begin() + N + i, left.begin());
		sort(all(left));
		copy(a.begin() + N + i, a.end(), right.begin());
		sort(all(right));

		copy(left.begin() + i, left.begin() + i + N, left2.begin());
		copy(right.begin(), right.begin() + N, right2.begin());
		int score = accumulate(all(left2), 0) - accumulate(all(right2), 0);
		if (min < score) {
			min = score;
		}
	}
	printf("%d\n", min);
}

Compiler output:
a.cc:67:10: fatal error: Main.h: No such file or directory
   67 | #include "Main.h"
      |          ^~~~~~~~
compilation terminated.
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define inf INT_MAX/3
#define INF INT_MAX/3
#define PB push_back
#define pb push_back
#define MP make_pair
#define mp make_pair
#define ALL(a) (a).begin(),(a).end()
#define all(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define debug(x) cout<<#x<<": "<<x<<endl
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define in scanf
#define out printf
#define LL long long
#define ll long long
#define ULL unsigned long long
#define ull unsigned long long
#define eps 1e-14
#define FST first
#define SEC second

#define sint(x) int x; scanf("%d",&x);
#define sint2(x,y) int x,y; scanf("%d %d",&x,&y);
#define lint(x) long long x; scanf("%lld",&x);
#define vint(v,n) vector<int> v(n); rep(i,n) scanf("%d", &v[i]);
#define vlint(v,n) vector<lint> v(n); rep(i,n) scanf("%lld", &v[i]);
#define sdouble(x) double x; scanf("%lf",&x);
#define vdouble(v,n) vector<double> v(n); rep(i,n) scanf("%lf", &v[i]);
#define schar(x) char x; scanf(" %c", &x);
#define sstring(x) string x; cin >> x;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;


int main(int argc, char** argv) {
	sint(N);
	vint(a, 3 * N);
	int min = INT_MIN;
	rep(i, N + 1) {
		vector<int> left(N + i), right(2 * N - i), left2(N), right2(N);
		copy(a.begin(), a.begin() + N + i, left.begin());
		sort(all(left));
		copy(a.begin() + N + i, a.end(), right.begin());
		sort(all(right));

		copy(left.begin() + i, left.begin() + i + N, left2.begin());
		copy(right.begin(), right.begin() + N, right2.begin());
		int score = accumulate(all(left2), 0) - accumulate(all(right2), 0);
		if (min < score) {
			min = score;
		}
	}
	printf("%d\n", min);
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:68:19: error: 'INT_MIN' was not declared in this scope
   68 |         int min = INT_MIN;
      |                   ^~~~~~~
a.cc:62:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   61 | #include <numeric>
  +++ |+#include <climits>
   62 | using namespace std;
Language: C++

# include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <math.h>
# include <algorithm>
using namespace std;
# define pi acos(-1.0)
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
typedef long long LL;
typedef unsigned long long ULL;
int a[3005],b[3005]；
LL c[3005];
bool cmp1(int a,int b)
{
    return a>b;
}
bool cmp2(int a,int b)
{
    return a<b;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=3*n;i++)
        scanf("%d",&a[i]);
    for(int i=n;i<=2*n;i++)
    {
        LL s1=0,s2=0;
        //for(int j=1;j<=3*n;j++)b[j]=a[j];
        strcpy((char*)b,(char*)a);
        sort(b+1,b+i+1);
        for(int j=i,z=1;z<=n;j--,z++)s1+=b[j];
        sort(b+i+2,b+3*n+1);
        for(int j=i+1,z=1;z<=n;j++,z++)s2+=b[j];
        c[i]=s1-s2;
    }
    sort(c+n+1,c+2*n+1);
    cout<<c[2*n];
    return 0;
}





















Compiler output:
a.cc:18:20: error: expected initializer before '\U0000ff1b'
   18 | int a[3005],b[3005]；
      |                    ^~
a.cc: In function 'int main()':
a.cc:38:23: error: 'b' was not declared in this scope
   38 |         strcpy((char*)b,(char*)a);
      |                       ^
a.cc:43:9: error: 'c' was not declared in this scope
   43 |         c[i]=s1-s2;
      |         ^
a.cc:45:10: error: 'c' was not declared in this scope
   45 |     sort(c+n+1,c+2*n+1);
      |          ^
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long[] a = new long[3 * N];
    for(int i = 0; i < 3 * N; i++) {
      a[i] = sc.nextLong();
    }
    PriorityQueue<Long> pq = new PriorityQueue<Long>();
    long[] max = new long[N + 1];
    for(int i = 0; i < N; i++) {
      pq.add(a[i]);
      max[0] += a[i];
    }
    for(int i = 1; i < N + 1; i++) {
      pq.add(a[N + i - 1]);
      long m = pq.poll();
      max[i] = max[i - 1] + a[N + i - 1] - m;
    }
 
    PriorityQueue<Long> pq2 = new PriorityQueue<>(N, Collections.reverseOrder());
    long[] min = new long[N + 1];
    for(int i = 3 * N - 1; i > 2 * N - 1; i--) {
      pq2.add(a[i]);
      min[0] += a[i];
    }
    for(int i = 1; i < N + 1; i++) {
      pq2.add(a[2 * N - i]);
      long m = pq2.poll();
      min[i] = min[i - 1] + a[2 * N - i] - m;
    }
    long ans = -1000000000000000000;
    for(int i = 0; i < N + 1; i++) {
      ans = Math.max(ans, max[i] - min[N - i]);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:34: error: integer number too large
    long ans = -1000000000000000000;
                ^
1 error
Language: C++

#include <iostream>
#include <queue>
#include <vector>
#include <limits>

using namespace std;
using ll = long long;

int main(){

	// 入力 int N = N, vector a = {a_1, a_2, ... a_N*3} 
	int N;
	cin >> N;
	int N3 = N * 3;

	vector<ll> a(N3);

	for (int i=0; i<N3; ++i){
		cin >> a[i];
	}

	// 優先度つきキューの作成
	// pq_front: 前から N+k 個の要素で常に最大のN要素をもつキュー（降順に取り出す）
	// pq_back: 後ろから N+k　個の要素で常に最小のN要素をもつキュー（昇順に取り出す）
	priority_queue<ll, vector<ll>, greater<ll>> pq_front;
	priority_queue<ll> pq_back;

	// sum_front[k]: あるkに対するpq_front の総和
	// sum_front[k]: あるkに対するpq_back の総和
	vector<ll> sum_front(N+1, 0), sum_back(N+1, 0);

	// pq_front(back)に前から（後ろから）N要素を追加、sum_front(back)を計算
	for (int i=0; i<N; ++i){
		pq_front.push(a[i]);
		pq_back.push(a[N3 - i - 1]);
		sum_front[0] += a[i];
		sum_back[N] += a[N3 - i - 1];
	}

	// k = 0, 1, ... , N-1 に対してsum_front(back)を計算
	for (int k=0; k<N; ++k){
		// a_k+N を pq_front に追加、最小要素をpopして総和を更新。
		pq_front.push(a[N+k]);
		pq_back.push(a[N*2-k-1]);

		sum_front[k+1] = sum_front[k] + a[N+k] - pq_front.top();
		sum_back[N-k-1] = sum_back[N-k] + a[N*2-k-1] - pq_back.top();

		pq_front.pop();
		pq_back.pop();

	}

	// sum_front[k] - sum_back[k] の最大値を計算
	ll max_score = LLONG_MIN;
	for (int k=0; k<=N; ++k){
		ll score = sum_front[k] - sum_back[k];
		if (max_score < score){
			max_score = score;
		}

	}

	// 出力
	cout << max_score << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:24: error: 'LLONG_MIN' was not declared in this scope
   55 |         ll max_score = LLONG_MIN;
      |                        ^~~~~~~~~
a.cc:5:1: note: 'LLONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <limits>
  +++ |+#include <climits>
    5 |