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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
  unsigned long long x, y, z, k;
  vector<unsigned long long> A;
  vector<unsigned long long> B;
  vector<unsigned long long> C;
  cin >> x >> y >> z >> k;  
  for(int i=0; i<x; i++){
    unsigned long long tmp;
    cin >> tmp;
	A.push_back(tmp);
  }
  for(int i=0; i<y; i++){
    unsigned long long tmp;
    cin >> tmp;
	B.push_back(tmp);
  }
  for(int i=0; i<z; i++){
    unsigned long long tmp;
    cin >> tmp;
	C.push_back(tmp);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  
  int a=A.size()-1, b=B.size()-1, c=C.size()-1;
  for(int i=0; i<k || i<(a+1)*(b+1)*(c+1); i++){
    unsigned long long sum;
    sum = A[a]+B[b]+C[c];
    cout << sum << endl;
    unsigned long long big=0;
    if(a-1>=0){
      if(big<A[a-1]){
	    big = A[a-1];
        char bigc = 'a';
      }
    }
    if(b-1>=0){
      if(big<B[b-1]){
        big = B[b-1];
        bigc='b';
      }
    }
    if(c-1>=0){
      if(big<C[c-1]){
        big = C[c-1];
        bigc = 'c';
      }
    }
    if(bigc=='a')a--;
    if(bigc=='b')b--;
    if(bigc=='c')c--;
    
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'bigc' was not declared in this scope; did you mean 'big'?
   47 |         bigc='b';
      |         ^~~~
      |         big
a.cc:53:9: error: 'bigc' was not declared in this scope; did you mean 'big'?
   53 |         bigc = 'c';
      |         ^~~~
      |         big
a.cc:56:8: error: 'bigc' was not declared in this scope; did you mean 'big'?
   56 |     if(bigc=='a')a--;
      |        ^~~~
      |        big
a.cc:57:8: error: 'bigc' was not declared in this scope; did you mean 'big'?
   57 |     if(bigc=='b')b--;
      |        ^~~~
      |        big
a.cc:58:8: error: 'bigc' was not declared in this scope; did you mean 'big'?
   58 |     if(bigc=='c')c--;
      |        ^~~~
      |        big
Language: C++

/*
オーダー
10**6	余裕を持って間に合う	
10**7	おそらく間に合う	余裕を持って間に合う
10**8	非常にシンプルな処理でない限り厳しい	おそらく間に合う
10**9		非常にシンプルな処理でない限り厳しい
logn	:OK
n		:10^7
nlogn	:10^6
n**2	:10^4
n**3	:300
2**n	:20
n!		:10



// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/

#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18
// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
ll gcd(ll a, ll b) {
	if(b == 0) return a;
	return gcd(b, a % b);
}

// const ll MAX_N = 1e5;
// ll N;
// ll h[MAX_N];
// ll dp[MAX_N+1]; // メモ化テーブル
 
// // i番目以降の品物から重さの総和がj以下になるように選ぶ
// void rec(ll i){
// 	if (i==0) dp[i] = 0;
// 	else if (i==1) dp[i] = abs(h[1]-h[0]);
// 	else dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
// 	return;
// }
 
 
int main() {
	// 入力
	ll X,Y,Z,K;
	cin >>X>>Y>>Z>>K;
	// ll A[X],B[Y],C[Z];
	ll A[1000],B[1000],C[1000];
	for (ll i = 0; i < X; ++i) cin >> A[i];
	for (ll i = 0; i < Y; ++i) cin >> B[i];
	for (ll i = 0; i < Z; ++i) cin >> C[i];
	X = 1000;
	Y = 1000;
	Z = 1000;
	
	// 解法
	sort(A,A+X, greater<ll>());
	sort(B,B+Y, greater<ll>());
	sort(C,C+Z, greater<ll>());
	
	ll step = 0;
	ll AB[X*Y];
	REP(i,X){
		REP(j,Y){
			AB[step] = A[i]+B[j];
			step++;
		}
	}
	sort(AB,AB+X*Y, greater<ll>());

	ll ans[K*K];
	step = 0;
	ll upper = min(K,X*Y);
	ll upper2 = Z;
	REP(i,upper){
		REP(l,upper2){
			ans[step] = AB[i]+C[l];
			step++;
		}
	}
	sort(ans,ans+upper*upper2, greater<ll>());

Compiler output:
a.cc: In function 'int main()':
a.cc:145:51: error: expected '}' at end of input
  145 |         sort(ans,ans+upper*upper2, greater<ll>());
      |                                                   ^
a.cc:107:12: note: to match this '{'
  107 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#inlucde <vector>
using namespace std;
using ll = long long;

int main() {
  int X, Y, Z, K;
  cin >> X >> Y >> Z >> K;
  vector<ll> A(X);
  vector<ll> B(Y);
  vector<ll> C(Z);
  for (int i = 0; i < X; i++) cin >> A[i];
  for (int i = 0; i < Y; i++) cin >> B[i];
  for (int i = 0; i < Z; i++) cin >> C[i];
  
  vector<ll> ab;
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < Y; j++) {
      ab.push_back(A[i] + B[j]);
    }
  }
  sort(ab.begin(), ab.end(), greater<>());
  
  vector<ll> ans;
  for (int i = 0; i < K; i++) {
    for (int j = 0; j < Z; j++) {
      ans.push_back(ab[i] + C[j]);
    }
  }
  sort(ans.begin(), ans.end(), greater<>());
  
  for (int i = 0; i < K; i++) cout << ans[i] << endl;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlucde; did you mean #include?
    3 | #inlucde <vector>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<ll> A(X);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | #inlucde <vector>
a.cc:10:12: error: expected primary-expression before '>' token
   10 |   vector<ll> A(X);
      |            ^
a.cc:10:14: error: 'A' was not declared in this scope
   10 |   vector<ll> A(X);
      |              ^
a.cc:11:12: error: expected primary-expression before '>' token
   11 |   vector<ll> B(Y);
      |            ^
a.cc:11:14: error: 'B' was not declared in this scope
   11 |   vector<ll> B(Y);
      |              ^
a.cc:12:12: error: expected primary-expression before '>' token
   12 |   vector<ll> C(Z);
      |            ^
a.cc:12:14: error: 'C' was not declared in this scope
   12 |   vector<ll> C(Z);
      |              ^
a.cc:17:12: error: expected primary-expression before '>' token
   17 |   vector<ll> ab;
      |            ^
a.cc:17:14: error: 'ab' was not declared in this scope; did you mean 'abs'?
   17 |   vector<ll> ab;
      |              ^~
      |              abs
a.cc:25:12: error: expected primary-expression before '>' token
   25 |   vector<ll> ans;
      |            ^
a.cc:25:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |   vector<ll> ans;
      |              ^~~
      |              abs
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  int X, Y , Z, K;
  cin >> X >> Y >> Z >> K;
  vector<long> A, B, C;
  long tmp;
  for(int i = 0; i < X; ++i) {
    cin >> tmp;
    A.push_back(tmp);
  }
  for(int i = 0; i < Y; ++i) {
    cin >> tmp;
    B.push_back(tmp);
  }
  for(int i = 0; i < Z; ++i) {
    cin >> tmp;
    C.push_back(tmp);
  }  
  sort(A.begin(),A.end(),greater<long>());
  sort(B.begin(),B.end(),greater<long>());
  sort(C.begin(),C.end(),greater<long>());
  vector<long> tmp;
  for (int i = 0; i < min(K,X); ++i) {
    for (int j = 0; j < min(K,Y); ++j) {
      tmp.push_back(A[i] + B[j]);
    }
  }
  sort(tmp.begin(),tmp.end(),greater<long>());
  
  vector<long> vec;
  for(int i = 0; i < K; ++i) {
    for(int j = 0; j < min(K,Z); ++j) {
       vec.push_back(tmp[i] + C[j]);
    }
  }
  sort(vec.begin(),vec.end(),greater<long>());

  for(int i = 0; i < K; ++i) {
    cout << vec[i] << endl;
  }
    
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: conflicting declaration 'std::vector<long int> tmp'
   27 |   vector<long> tmp;
      |                ^~~
a.cc:11:8: note: previous declaration as 'long int tmp'
   11 |   long tmp;
      |        ^~~
a.cc:30:11: error: request for member 'push_back' in 'tmp', which is of non-class type 'long int'
   30 |       tmp.push_back(A[i] + B[j]);
      |           ^~~~~~~~~
a.cc:33:12: error: request for member 'begin' in 'tmp', which is of non-class type 'long int'
   33 |   sort(tmp.begin(),tmp.end(),greater<long>());
      |            ^~~~~
a.cc:33:24: error: request for member 'end' in 'tmp', which is of non-class type 'long int'
   33 |   sort(tmp.begin(),tmp.end(),greater<long>());
      |                        ^~~
a.cc:38:25: error: invalid types 'long int[int]' for array subscript
   38 |        vec.push_back(tmp[i] + C[j]);
      |                         ^
Language: C++

#include<cstdio>
#include<string>
#include<iostream>
#include<cstring>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<vector>
#include<list>
#include<deque>
#include<functional>
#include<sstream>
#include<numeric>
#include<complex>

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DUMP(x) if(DBG){cerr << #x << " = " << (x) << endl;}
#define CLR(a) memset((a), 0 ,sizeof(a))
#define rep(i,n) for(int i=0;i<(int)n;i++)

#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define INF 1<<27
#define EPS 1e-8

#define DBG 0

using namespace std;

inline int to_int(string s) {int v; istringstream istr(s);istr>>v;return v;}
template<class T> inline string to_string(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;

const int dx[]={0,-1,0,1,1,1,-1,-1};
const int dy[]={1,0,-1,0,1,-1,1,-1};

int main()
{
	int x, y, z;
	ll k, c, a[1001], b[1001], c[1001];
	vector<ll> costs;

	cin >> x >> y >> z >> k;

	rep(j, x) cin >> a[i];
	rep(j, y) cin >> b[i];
	rep(j, z) cin >> c[i];

	rep(i, x) {
		rep(j, y){
			rep(l, z){
				costs.pb(a[i] + b[j] + c[l]);
			}
		}
	}

	sort(costs.begin(), costs.end(), greater<ll>());
	rep(i, k) cout << costs[i] << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:36: error: conflicting declaration 'll c [1001]'
   50 |         ll k, c, a[1001], b[1001], c[1001];
      |                                    ^
a.cc:50:15: note: previous declaration as 'll c'
   50 |         ll k, c, a[1001], b[1001], c[1001];
      |               ^
a.cc:55:28: error: 'i' was not declared in this scope
   55 |         rep(j, x) cin >> a[i];
      |                            ^
a.cc:56:28: error: 'i' was not declared in this scope
   56 |         rep(j, y) cin >> b[i];
      |                            ^
a.cc:57:28: error: 'i' was not declared in this scope
   57 |         rep(j, z) cin >> c[i];
      |                            ^
a.cc:62:57: error: invalid types 'll {aka long long int}[int]' for array subscript
   62 |                                 costs.pb(a[i] + b[j] + c[l]);
      |                                                         ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long ll;

const long long INF = 1LL << 60;

int main() {
    int X, Y, Z, K; cin >> X >> Y >> Z >> K;
    vector<ll> A(X), B(Y), C(Z);
    for (int i = 0; i < X; i++) cin >>A[i];
    for (int i = 0; i < Y; i++) cin >>B[i];
    for (int i = 0; i < Z; i++) cin >> C[i];

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());

    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    reverse(C.begin(), C.end());

    vector<ll> D(100000), E(111111), F(11111);
    for (int i = 0; i < X - 1; i++) D[i] = A[i + 1] - A[i];
    for (int i = 0; i < Y - 1; i++) E[i] = B[i + 1] - B[i];
    for (int i = 0; i < Z - 1; i++) F[i] = C[i + 1] - C[i];

    ll maxi = A[0] + B[0] + C[0];
    printf("%lld\n", maxi);

    int x = 0, y = 0, z = 0;

    for (int i =0; i < K - 1; i++) {
        if (D[x] < E[y] && D[x] < F[z]) {
            maxi += D[x];
            printf("%lld\n", maxi);
            x++;
        }
        else if (D[x] > E[y] && E[y] < F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] > F[z] && E[y] > F[z]) {
            maxi += F[z];
            printf("%lld\n", maxi);
            z++;
        }
        else if (D[x] == E[y] && E[y] == F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] > E[y] && E[y] == F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] < E[y] && D[x] == F[z]) {
            maxi += D[x];
            printf("%lld\n", maxi);
            x++;
        }
        else if (D[x] > F[z] && E[y] == F[z]) {
            maxi += F[z];
            printf("%lld\n", maxi);
            z++;
        }

        if (X - 2== x)  for (int g =X -2; g < N ;g++)D[g] =INF;
        if (Y - 2== y)  for (int h =Y -2; h < N ;h++)E[h] =INF;
        if (Z - 2== z) for (int f =Z -2; f < N ;f++)F[f] =INF;

    }



Compiler output:
a.cc: In function 'int main()':
a.cc:70:47: error: 'N' was not declared in this scope
   70 |         if (X - 2== x)  for (int g =X -2; g < N ;g++)D[g] =INF;
      |                                               ^
a.cc:71:47: error: 'N' was not declared in this scope
   71 |         if (Y - 2== y)  for (int h =Y -2; h < N ;h++)E[h] =INF;
      |                                               ^
a.cc:72:46: error: 'N' was not declared in this scope
   72 |         if (Z - 2== z) for (int f =Z -2; f < N ;f++)F[f] =INF;
      |                                              ^
a.cc:74:6: error: expected '}' at end of input
   74 |     }
      |      ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long ll;

const long long INF = 1LL << 60;

int main() {
    int X, Y, Z, K; cin >> X >> Y >> Z >> K;
    vector<ll> A(X), B(Y), C(Z);
    for (int i = 0; i < X; i++) scanf("%lld\n", A[i]);
    for (int i = 0; i < Y; i++) scanf("%lld\n", B[i]);
    for (int i = 0; i < Z; i++) scanf("%lld\n", C[i]);

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());

    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    reverse(C.begin(), C.end());

    vector<ll> D(100000), E(111111), F(11111);
    for (int i = 0; i < X - 1; i++) D[i] = A[i + 1] - A[i];
    for (int i = 0; i < Y - 1; i++) E[i] = B[i + 1] - B[i];
    for (int i = 0; i < Z - 1; i++) F[i] = C[i + 1] - C[i];

    ll maxi = A[0] + B[0] + C[0];
    printf("%lld\n", maxi);

    int x = 0, y = 0, z = 0;

    for (int i =0; i < K - 1; i++) {
        if (D[x] < E[y] && D[x] < F[z]) {
            maxi += D[x];
            printf("%lld\n", maxi);
            x++;
        }
        else if (D[x] > E[y] && E[y] < F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] > F[z] && E[y] > F[z]) {
            maxi += F[z];
            printf("%lld\n", maxi);
            z++;
        }
        else if (D[x] == E[y] && E[y] == F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] > E[y] && E[y] == F[z]) {
            maxi += E[y];
            printf("%lld\n", maxi);
            y++;
        }
        else if (D[x] < E[y] && D[x] == F[z]) {
            maxi += D[x];
            printf("%lld\n", maxi);
            x++;
        }
        else if (D[x] > F[z] && E[y] == F[z]) {
            maxi += F[z];
            printf("%lld\n", maxi);
            z++;
        }

        if (X - 2== x)  for (int g =X -2; g < N ;g++)D[g] =INF;
        if (Y - 2== y)  for (int h =Y -2; h < N ;h++)E[h] =INF;
        if (Z - 2== z) for (int f =Z -2; f < N ;f++)F[f] =INF;

    }



}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:47: error: 'N' was not declared in this scope
   70 |         if (X - 2== x)  for (int g =X -2; g < N ;g++)D[g] =INF;
      |                                               ^
a.cc:71:47: error: 'N' was not declared in this scope
   71 |         if (Y - 2== y)  for (int h =Y -2; h < N ;h++)E[h] =INF;
      |                                               ^
a.cc:72:46: error: 'N' was not declared in this scope
   72 |         if (Z - 2== z) for (int f =Z -2; f < N ;f++)F[f] =INF;
      |                                              ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
  unsigned long long x, y, z, k;
  vector<unsigned long long> A;
  vector<unsigned long long> B;
  vector<unsigned long long> C;
  cin >> x >> y >> z >> k;  
  for(int i=0; i<x; i++){
    unsigned long long tmp;
    cin >> tmp;
	A.push_back(tmp);
  }
  for(int i=0; i<y; i++){
    unsigned long long tmp;
    cin >> tmp;
	B.push_back(tmp);
  }
  for(int i=0; i<z; i++){
    unsigned long long tmp;
    cin >> tmp;
	C.push_back(tmp);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  
  int a=A.size()-1, b=B.size()-1, c=C.size()-1;
  for(int i=0; i<k || i<(a+1)*(b+1)*(c+1); i++){
    unsigned long long sum;
    sum = A[a]+B[b]+C[c];
    cout << sum << endl;
    unsigned long long a--;
    if(big<B[b])b--;
    if(big<C[c])c--;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:25: error: expected initializer before '--' token
   37 |     unsigned long long a--;
      |                         ^~
a.cc:38:8: error: 'big' was not declared in this scope
   38 |     if(big<B[b])b--;
      |        ^~~
a.cc:39:8: error: 'big' was not declared in this scope
   39 |     if(big<C[c])c--;
      |        ^~~
Language: C++

/* D */

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x, y, z, t;
	cin >> x >> y >> z >> t;
	int* a = new int[x];
	int* b = new int[y];
	int* c = new int[z];

	long long int l = x * y * z;
	std::vector<int> deli(l);

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

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

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

	sort(a, a+x);
	sort(b, b+y);
	sort(c, c+z);
	
	int p = 0;

    int* all = new int[l];
    for (int i = 0; i < x; ++i)
    {
    	for (int j = 0; j < y; ++j)
    	{
    		for (int k = 0; k < z; ++k)
    		{
    			all[p] = a[i] + b[j] + c[k];
    			p++;
    		}
    	}
    }
	
	sort(all, all + l);

	for (int i = 0; i < t; ++i)
	{
		cout << all[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: 'vector' is not a member of 'std'
   15 |         std::vector<int> deli(l);
      |              ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:15:21: error: expected primary-expression before 'int'
   15 |         std::vector<int> deli(l);
      |                     ^~~
Language: C++

X,Y,Z,K=map(int,input().split())
A=[int(x) for x in input().split()]
A.sort(reverse=True)
B=[int(x) for x in input().split()]
B.sort(reverse=True)
C=[int(x) for x in input().split()]
C.sort(reverse=True)
D=[a+b for a in A for b in B]
D.sort(reverse=True)
D=D[:3000]
E=[ab+c for ab in D for c in C]
E.sort(reverse=True)
for i in range(K):
  print(E[i])


Compiler output:
a.cc:1:1: error: 'X' does not name a type
    1 | X,Y,Z,K=map(int,input().split())
      | ^
Language: C++

X,Y,Z,K=map(int,input().split())
A=[int(x) for x in input().split()]
A.sort(reverse=True)
B=[int(x) for x in input().split()]
B.sort(reverse=True)
C=[int(x) for x in input().split()]
C.sort(reverse=True)
D=[a+b for a in zip(A,B)]
D.sort(reverse=True)
D=D[:3000]
E=[ab+c for ab in D for c in C]
E.sort(reverse=True)
for i in range(K):
  print(E[i])

Compiler output:
a.cc:1:1: error: 'X' does not name a type
    1 | X,Y,Z,K=map(int,input().split())
      | ^
Language: C++

/* D */

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x, y, z, t;
	cin >> x >> y >> z >> t;
	int* a = new int[x];
	int* b = new int[y];
	int* c = new int[z];
	std::vector<int> deli;

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

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

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

	sort(a, a+x);
	sort(b, b+y);
	sort(c, c+z);
	

	long long int l = x * y * z;

	int p = 0;

    int* all = new int[l];
    for (int i = 0; i < x; ++i)
    {
    	for (int j = 0; j < y; ++j)
    	{
    		for (int k = 0; k < z; ++k)
    		{
    			all[p] = a[i] + b[j] + c[k];
    			p++;
    		}
    	}
    }
	
	sort(all, all + l);

	for (int i = 0; i < t; ++i)
	{
		cout << all[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'vector' is not a member of 'std'
   13 |         std::vector<int> deli;
      |              ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:13:21: error: expected primary-expression before 'int'
   13 |         std::vector<int> deli;
      |                     ^~~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x, y, z, k;
	vll da, db, dc;

	cin>>x>>y>>z>>k;
	vll A(x), B(y), C(z);
	rep(i, x){
		cin >> A[i];
	}
	rep(i, y){
		cin >> B[i];
	rep(i, z){
		cin >> C[i];
	}
	sort(rall(A));
	sort(rall(B));
	sort(rall(C));
	rep(i, x){
		da.pb(A[0]-A[i]);
	}
	rep(i, y-1){
		db.pb(B[0]-B[i+1]);
	}
	rep(i, z-1){
		dc.pb(C[0]-C[i+1]);
	}
	ll asize = da.size();
	rep(i, db.size()){
		rep(j, asize){
			da.pb(da[j]+db[i]);
		}
	}
	asize = da.size();
	rep(i, dc.size()){
		rep(j, asize){
			da.pb(da[j]+dc[i]);
		}
	}
	ll sum = A[0]+B[0]+C[0];
	sort(all(da));
	rep(i, k){
		cout << sum-da[i] << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
const ll MOD=100000007;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans%MOD*(b&1?a:1)%MOD;
}
inline constexpr int modf(ll n){
    ll ans=1;
    rep(i,0,n) {ans=ans*(n-i)%MOD;}
    return ans;
}
int main(){
    ll x,y,z,k;
    cin>>x>>y>>z>>k;
    vector<ll> xx(x),yy(y),zz(z);
    rep(i,0,x) cin>>xx[i];
    rep(i,0,y) cin>>yy[i];
    rep(i,0,z) cin>>zz[i];
    sort(xx.begin(),xx.end());
    sort(yy.begin(),yy.end());
    sort(zz.begin(),zz.end());
    reverse(xx.begin(),xx.end());
    reverse(yy.begin(),yy.end());
    reverse(zz.begin(),zz.end());
    rep(i,0,k){
        cout<<xx[0]+yy[0]+zz[0];
        if(k-i){
            ll t;
            t=min(xx[1]-xx[0],yy[1]-yy[0],zz[1]-zz[0])
            if(t==yy[1]-yy[0]) erase(yy.begin,yy.end);
            if(t==xx[1]-xx[0]) erase(xx.begin,xx.end);
            if(t==zz[1]-zz[0]) erase(zz.begin,zz.end);
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:55: error: expected ';' before 'if'
   41 |             t=min(xx[1]-xx[0],yy[1]-yy[0],zz[1]-zz[0])
      |                                                       ^
      |                                                       ;
   42 |             if(t==yy[1]-yy[0]) erase(yy.begin,yy.end);
      |             ~~                                         
a.cc:43:32: error: 'erase' was not declared in this scope
   43 |             if(t==xx[1]-xx[0]) erase(xx.begin,xx.end);
      |                                ^~~~~
a.cc:44:32: error: 'erase' was not declared in this scope
   44 |             if(t==zz[1]-zz[0]) erase(zz.begin,zz.end);
      |                                ^~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:41:18:   required from here
   41 |             t=min(xx[1]-xx[0],yy[1]-yy[0],zz[1]-zz[0])
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+18;

int main() {
    ios::sync_with_stdio(false);   
    Int x, y, z;
    Int k;
    cin >> x >> y >> z >> k;
    vector<Int> a(x), b(y), c(z);
    for (Int i = 0; i < x; i++) cin >> a[i];
    for (Int i = 0; i < y; i++) cin >> b[i];
    for (Int i = 0; i < z; i++) cin >> c[i];
    sort(a.begin(), a.end(), greater<Int>());
    sort(b.begin(), b.end(), greater<Int>());
    sort(c.begin(), c.end(), greater<Int>());
    priority_queue<tuple<Int, Int, Int, Int>> q;
    q.push(make_tuple(a[0] + b[0] + c[0], 0, 0, 0));
    Int cnt = 0;
    while (cnt < k) { 
        tuple(Int, Int, Int, Int) = q.top();
        q.pop();
        dump(get<0>(t));
        Int p1 = get<1>(t);
        Int p2 = get<2>(t);
        Int p3 = get<3>(t);
        if (p1 < x) {
            q.push(make_tuple(a[p1] + b[p2] + c[p3], p1 + 1, p2, p3));
        }
        if (p2 < y) {
            q.push(make_tuple(a[p1] + b[p2] + c[p3], p1, p2 + 1, p3));
        }
        if (p3 < z) {
            q.push(make_tuple(a[p1] + b[p2] + c[p3], p1, p2, p3 + 1));
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: missing template arguments before '(' token
   24 |         tuple(Int, Int, Int, Int) = q.top();
      |              ^
a.cc:24:18: error: expected primary-expression before ',' token
   24 |         tuple(Int, Int, Int, Int) = q.top();
      |                  ^
a.cc:24:23: error: expected primary-expression before ',' token
   24 |         tuple(Int, Int, Int, Int) = q.top();
      |                       ^
a.cc:24:28: error: expected primary-expression before ',' token
   24 |         tuple(Int, Int, Int, Int) = q.top();
      |                            ^
a.cc:24:33: error: expected primary-expression before ')' token
   24 |         tuple(Int, Int, Int, Int) = q.top();
      |                                 ^
a.cc:26:21: error: 't' was not declared in this scope
   26 |         dump(get<0>(t));
      |                     ^
a.cc:3:26: note: in definition of macro 'dump'
    3 | #define dump(x) cout << (x) << '\n';
      |                          ^
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
using namespace std;



int main() {
    cout << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    ll x, y, z, k;
    cin >> x >> y >> z >> k;
    ll sz[] = {x, y, z};
    vector<vector<ll>> a;
    for (int i = 0; i < 3; i++) {
        a.pb(vector<ll>());
        for (int j = 0; j < sz[i]; j++) {
            ll e;
            cin >> e;
            a[i].pb(e);
        }

        sort(a[i].begin(), a[i].end(), greater<ll>());
    }

    sort (a.begin(), a.end());
    reverse(a.begin(), a.end());


    vector<ll> just;
    for (int e : a[1]) {
        for (int ee : a[2]) {
            just.pb(e + ee);
        }
    }

    sort (just.begin(), just.end(), greater<ll>());
//    for (int e : a[0]) {
//        cout << e << ' ';
//    }

    int count = 0;
    vector<ll> ans;
    while (count < k) {
        for (int i = 0; i < a[0].size(); i++) {
            for (int j = 0; j < just.size(); j++) {
                ans.pb(a[0][i] + just[j]);
                count++;
            }
        }
    }

    sort (ans.begin(), ans.end(), greater<ll>()) {
        for (ll e : ans) {
            cout << e << '\n';
        }
    }





}




Compiler output:
a.cc: In function 'int main()':
a.cc:60:49: error: expected ';' before '{' token
   60 |     sort (ans.begin(), ans.end(), greater<ll>()) {
      |                                                 ^~
      |                                                 ;
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define SORT(c) sort((c).begin(),(c).end())

using namespace std;

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();}

//sort(v.rbegin(), v.rend(), [](auto& x, auto& y){return x[1] < y[1];});
//cout << fixed << setprecision(10) << ans << defaultfloat << endl;
typedef long long ll;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef vector<double> Vd;
typedef vector<string> Vs;

ll mod = 1e9+7;

int main() {
    int X,Y,Z,K;
    cin >> X >> Y >> Z >> K;

    Vl A(X),B(Y),C(Z),tmp(X*Y),ans;
    REP(i,X) cin >> A[i];
    REP(i,Y) cin >> B[i];
    REP(i,Z) cin >> C[i];

    sort(A.rbegin(),A.rend());
    sort(B.rbegin(),B.rend());
    sort(C.rbegin(),C.rend());
    REP(i,X) {
        REP(j,Y) {
            tmp[i*Y+j] = A[i]+B[j];
        }
    }
    sort(tmp.rbegin(),tmp.rend());

    ll m = 0,count = 0;
    REP(i,Z) {
        REP(j,X+Y) {
            ll t = C[i]+tmp[j];
            if (count>=K && m>t) {
                break;
            }
            count++;
            m = min(t,m);
            ans.push_back(t);
        }
    }
    sort(ans.rbegin(),ans.rend());
    if (K>1) {
        REP(i,K) cout << ans[i] << endl;
    }
    else {
        reverse(ans.begin(),ans.end())
        cout << ans[0] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:39: error: expected ';' before 'cout'
   57 |         reverse(ans.begin(),ans.end())
      |                                       ^
      |                                       ;
   58 |         cout << ans[0] << endl;
      |         ~~~~
Language: C++

/* D */

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x, y, z, t;
	cin >> x >> y >> z >> t;
	int* a = new int[x];
	int* b = new int[y];
	int* c = new int[z];
	std::vector<int> deli;

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

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

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

	sort(a, a+x);
	sort(b, b+y);
	sort(c, c+z);
	

	long long int l = x * y * z;

    int* all = new int[l];
    for (int i = 0; i < x; ++i)
    {
    	for (int j = 0; j < y; ++j)
    	{
    		for (int k = 0; k < z; ++k)
    		{
    			all = a[i] + b[j] + c[k];
    		}
    	}
    }
	
	sort(all, all + l);

	for (int i = 0; i < t; ++i)
	{
		cout << all[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'vector' is not a member of 'std'
   13 |         std::vector<int> deli;
      |              ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:13:21: error: expected primary-expression before 'int'
   13 |         std::vector<int> deli;
      |                     ^~~
a.cc:44:43: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   44 |                         all = a[i] + b[j] + c[k];
      |                               ~~~~~~~~~~~~^~~~~~
      |                                           |
      |                                           int
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
  unsigned long long x, y, z, k;
  vector<unsigned long long> A;
  vector<unsigned long long> B;
  vector<unsigned long long> C;
  cin >> x >> y >> z >> k;  
  for(int i=0; i<x; i++){
    unsigned long long tmp;
    cin >> tmp;
	A.push_back(tmp)
  }
  for(int i=0; i<y; i++){
    unsigned long long tmp;
    cin >> tmp;
	B.push_back(tmp)
  }
  for(int i=0; i<z; i++){
    unsigned long long tmp;
    cin >> tmp;
	C.push_back(tmp)
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  
  int a=A.size()-1, b=B.size()-1, c=C.size()-1;
  for(int i=0; i<k || i<(a+1)*(b+1)*(c+1); i++){
    unsigned long long sum;
    sum = A[a]+B[b]+C[c];
    cout << sum << endl;
    unsigned long long big = A--;
    if(big<B[b])b--;
    if(big<C[c])c--;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before '}' token
   16 |         A.push_back(tmp)
      |                         ^
      |                         ;
   17 |   }
      |   ~                      
a.cc:21:25: error: expected ';' before '}' token
   21 |         B.push_back(tmp)
      |                         ^
      |                         ;
   22 |   }
      |   ~                      
a.cc:26:25: error: expected ';' before '}' token
   26 |         C.push_back(tmp)
      |                         ^
      |                         ;
   27 |   }
      |   ~                      
a.cc:37:31: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   37 |     unsigned long long big = A--;
      |                              ~^~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
int main(){
  ll X, Y, Z, K, tmp;
  cin >> X >> Y >> Z >> K;
  vector<ll> A, B, C;
  for (int i=0; i<X; i++){
    cin >> tmp;
    A.push_back(tmp);
  }
  for (int i=0; i<Y; i++){
    cin >> tmp;
    B.push_back(tmp);
  }
  for (int i=0; i<Z; i++){
    cin >> tmp;
    C.push_back(tmp);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  ll pa = A.size() - 1; pb = B.size() - 1; pc = C.size() - 1;
  ll count = 0;
  ll sa, sb, sc;
  while(count < K){
    cout << A[pa] + B[pb] + C[pc];
    sa = A[pa] - A[pa - 1];
    sb = A[pb] - A[pb - 1];
    sc = A[pc] - A[pc - 1];
    if (pa < pb && pa < pc && pa >= 0)pa--;
    else if (pb < pa && pb < pc && pb >= 0)pb--;
    else if (pc >= 0)pc--;
    count++;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'pb' was not declared in this scope; did you mean 'pa'?
   26 |   ll pa = A.size() - 1; pb = B.size() - 1; pc = C.size() - 1;
      |                         ^~
      |                         pa
a.cc:26:44: error: 'pc' was not declared in this scope; did you mean 'pa'?
   26 |   ll pa = A.size() - 1; pb = B.size() - 1; pc = C.size() - 1;
      |                                            ^~
      |                                            pa
Language: C

#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
    long long a[1100], b[1100], c[1100], k, x, y, p;
    int i, j, l;
    scanf("%lld%lld%lld%lld",&x,&y,&p,&k);
    for(i=0;i<x;i++)
    {
        scanf("%lld",&a[i]);
    }
    for(i=0;i<y;i++)
    {
        scanf("%lld",&b[i]);
    }
    for(i=0;i<p;i++)
    {
        scanf("%lld",&c[i]);
    }
    sort(a,a+x);
    sort(b,b+y);
    sort(c,c+p);
    for(i=x-1,j=y-1,l=p-1;;)
            {
                k--;
                printf("%lld\n",a[i]+b[j]+c[l]);
                if(a[i]-a[i-1]<=b[j]-b[j-1])
                {
                    if(a[i]-a[i-1]<=c[l]-c[l-1])
                        {
                            if(i!=0)
                            i--;
                        else
                        {
                            if(j!=0&&b[j]-b[j-1]<=c[l]-c[l-1])
                                j--;
                            else
                                l--;
                        }
                        }
                    else
                    {
                        if(l!=0)
                        l--;
                        else
                        {
                            if(i!=0)
                                i--;
                            else
                                j--;
                        }
                    }
                }
                else
                {
                    if(b[j]-b[j-1]<=c[l]-c[l-1])
                    {
                        if(j!=0)
                            j--;
                        else
                        {
                            if(i!=0&&a[i]-a[i-1]<=c[l]-c[l-1])
                                i--;
                            else
                                l--;
                        }
                    }
                    else
                    {
                        if(l!=0)
                        l--;
                        else
                        {
                            if(j!=0)
                                j--;
                            else
                                i--;
                        }
                    }
                }
                if(k==0)
                    break;
            }
    return 0;
}


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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
  unsigned long long x, y, z, k;
  vector<unsigned long long> A;
  vector<unsigned long long> B;
  vector<unsigned long long> C;
  cin >> x >> y >> z >> k;  
  for(int i=0; i<x; i++){
    unsigned long long tmp;
    cin >> tmp;
	A.push_back(tmp)
  }
  for(int i=0; i<y; i++){
    unsigned long long tmp;
    cin >> tmp;
	B.push_back(tmp)
  }
  for(int i=0; i<z; i++){
    unsigned long long tmp;
    cin >> tmp;
	C.push_back(tmp)
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  sort(C.begin(), C.end());
  
  int a=A.size()-1, b=B.size()-1, c=C.size()-1;
  for(int i=0; i<k || i<(a+1)*(b+1)*(c+1); i++){
    unsigned long long sum;
    sum = A[a]+B[b]+C[c]
    cout << sum << endl;
    unsigned long long big = A--;
    if(big<B[b])b--;
    if(big<C[c])c--;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before '}' token
   16 |         A.push_back(tmp)
      |                         ^
      |                         ;
   17 |   }
      |   ~                      
a.cc:21:25: error: expected ';' before '}' token
   21 |         B.push_back(tmp)
      |                         ^
      |                         ;
   22 |   }
      |   ~                      
a.cc:26:25: error: expected ';' before '}' token
   26 |         C.push_back(tmp)
      |                         ^
      |                         ;
   27 |   }
      |   ~                      
a.cc:35:25: error: expected ';' before 'cout'
   35 |     sum = A[a]+B[b]+C[c]
      |                         ^
      |                         ;
   36 |     cout << sum << endl;
      |     ~~~~                 
a.cc:37:31: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   37 |     unsigned long long big = A--;
      |                              ~^~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x, y, z, k;
	vll A(x), B(y), C(z);
	vll da, db, dc;

	cin>>x>>y>>z>>k;
	rep(i, x){
		cin >> A[i];
	}
	rep(i, y){
		cin >> B[i];
	rep(i, z){
		cin >> C[i];
	}
	sort(rall(A));
	sort(rall(B));
	sort(rall(C));
	rep(i, x){
		da.pb(A[0]-A[i]);
	}
	rep(i, y-1){
		db.pb(B[0]-B[i+1]);
	}
	rep(i, z-1){
		dc.pb(C[0]-C[i+1]);
	}
	ll asize = da.size();
	rep(i, db.size()){
		rep(j, asize){
			da.pb(da[j]+db[i]);
		}
	}
	asize = da.size();
	rep(i, dc.size()){
		rep(j, asize){
			da.pb(da[j]+dc[i]);
		}
	}
	ll sum = A[0]+B[0]+C[0];
	sort(all(da));
	rep(i, k){
		cout << sum-da[i] << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;

int main(){
    int X,Y,Z,K; cin >> X >> Y >> Z >> K;
    vector<ll> A(X); for(int i=0;i<X;i++) cin >> A[i];
    vector<ll> B(Y); for(int i=0;i<Y;i++) cin >> B[i];
    vector<ll> C(Z); for(int i=0;i<Z;i++) cin >> C[i];
    vector<ll> s(X*Y*Z,-1);
    ll cnt=0;
    for(int i=0;i<X;i++){
        for(int j=0;j<Y;j++){
            for(int k=0;k<Z;k++){
                s[cnt++] = A[i]+B[j]+C[k];
            }
        }
    }
    sort<ll>(s.begin(),s.end());//,greater<ll>());
    for(int i=X*Y*Z-1;i>=X*Y*Z-K;i--){
        cout << s[i] << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: no matching function for call to 'sort<ll>(std::vector<long long int>::iterator, std::vector<long long int>::iterator)'
   31 |     sort<ll>(s.begin(),s.end());//,greater<ll>());
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = long long int]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from 'std::vector<long long int>::iterator' to 'long long int'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
#include <algorithm>
// #include <bits/stdc++.h> 
#include <functional> 
using namespace std;
const int N = 100000;
bool record[1005][1005][1005] = {0};
 
int main()
{
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    long long A[N] = {0}, B[N] = {0}, C[N] = {0};
    for (int i = 0; i < x; ++i) cin >> A[i];
    for (int i = 0; i < y; ++i) cin >> B[i];
    for (int i = 0; i < z; ++i) cin >> C[i];
    sort(A, A + x,greater<long>());
    sort(B, B + y,greater<long>());
    sort(C, C + z,greater<long>());

    int i = 0, j = 0, l = 0;
    while(k --){
        long long now_sum = 0;
        now_sum = A[i] + B[j] + C[l];
        cout << now_sum << endl;
        record[i][j][l] = 1;
        // long long  a, b, c, tmpsm = 9999999999, ans = 1;
        // if (i+1 < x && A[i] - A[i + 1] < tmpsm) {
        //     tmpsm = A[i] - A[i+1];
        //     ans = 1;
        // }
        // if (j+1 < y && B[j] - B[j + 1] < tmpsm) {
        //     tmpsm = B[j] - B[j+1];
        //     ans = 2;
        // }
        // if (l+1 < z && C[l] - C[l + 1] < tmpsm) {
        //     tmpsm = C[l] - C[l+1];
        //     ans = 3;
        // }
        long long ans_i  =0, ans_j =0, ans_l = 0;
        long long sum = -1;
        int s = 10;
        for (int I = i - s; I <= i+; ++I ){
            if (I < 0 or I >= x) continue;
            for (int J = j - s; J <= j+s; ++J ){
                if (J < 0 or J >= y) continue;
                for (int L = l - s; L <= l+s; ++L ){
                    if (L < 0 or L >= z) continue;
                    long long tmpsum = A[I] + B[J] + C[L];
                    // cout << I << ' ' << J << ' ' << L << ' ' << tmpsum<<endl;
                    if (tmpsum > now_sum) continue;
                    if (I == i && J == j && L == l) continue;
                    if (record[I][J][L] == 1) continue;
                    // cout << "in" << endl;
                    if (tmpsum > sum){
                        sum = tmpsum;
                        ans_i = I;
                        ans_j = J;
                        ans_l = L;
                    }

                }
            }
        }
        i = ans_i;
        j = ans_j;
        l = ans_l;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:36: error: expected primary-expression before ';' token
   43 |         for (int I = i - s; I <= i+; ++I ){
      |                                    ^