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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  int x,y,z,k;
  cin>>x>>y>>z>>k;
  long long a[x],b[y],c[z];
  REP(i,x){
    cin>>a[i];
  }
  REP(i,y){
    cin>>b[i];
  }
  REP(i,z){
    cin>>c[i];
  }
  
  vector<long long> ab;
  REP(i,x){
    REP(j,y){
      ab.push_back(a[i]+b[j]);
    }
  }
  sort(ab.begin(),ab.end(),greater<long long>());
  
  int s = ab.size();
  long long abm;
  REP(i,s){
    if(i<3000){
      abm.push_back(ab[i]);
    }else{
      break;
    }
  }
  
  int sm=abm.size();
  vector<long long> abc;
  REP(i,sm){
    REP(j,z){
      abc.push_back(abm[i]+c[j]);
    }
  }
  sort(abc.begin(),abc.end(),greater<long long>());
  
  REP(i,k){
    cout<<abc[i]<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:115:11: error: request for member 'push_back' in 'abm', which is of non-class type 'long long int'
  115 |       abm.push_back(ab[i]);
      |           ^~~~~~~~~
a.cc:121:14: error: request for member 'size' in 'abm', which is of non-class type 'long long int'
  121 |   int sm=abm.size();
      |              ^~~~
a.cc:125:24: error: invalid types 'long long int[int]' for array subscript
  125 |       abc.push_back(abm[i]+c[j]);
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,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];
  vector<long long>sum(0);
  for(int i=0;i<x;i++){
    for(int j=0;j<y;j++){
      for(int l=0;l<z;l++){
        sum.push_back((long long)a[i]+b[j]+c[l]);
      }
    }
  }
  sort(sum.begin(),sum.end());
  for(int i=0;i<min(k,sum.size());i++)cout<<sum[sum.size()-1-i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: no matching function for call to 'min(int&, std::vector<long long int>::size_type)'
   18 |   for(int i=0;i<min(k,sum.size());i++)cout<<sum[sum.size()-1-i]<<endl;
      |                 ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'})
   18 |   for(int i=0;i<min(k,sum.size());i++)cout<<sum[sum.size()-1-i]<<endl;
      |                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:18:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |   for(int i=0;i<min(k,sum.size());i++)cout<<sum[sum.size()-1-i]<<endl;
      |                 ~~~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,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];
  vector<long long>sum(0);
  for(int i=0;i<x;i++){
    for(int j=0;j<y;j++){
      for(int i=0;l<z;l++){
        sum.push_back((long long)a[i]+b[j]+c[l]);
      }
    }
  }
  sort(sum.begin(),sum.end());
  for(int i=0;i<k;i++)cout<<sum[sum.size()-1-i]<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'l' was not declared in this scope
   12 |       for(int i=0;l<z;l++){
      |                   ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define f(n) for(int i=0;i<n;i++)
using namespace std;
singed main(){
  int x,y,z,k;
  cin >> x >> y >> z >> k;
  int a[x];f(x)cin>>a[i];
  int b[y];f(y)cin>>b[i];
  int c[z];f(z)cin>>c[i];
  
  
  //cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:5:1: error: 'singed' does not name a type; did you mean 'signed'?
    5 | singed main(){
      | ^~~~~~
      | signed
Language: C++

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

using namespace std;

typedef long long ll;

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.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    sort(c.rbegin(), c.rend());

    ll ok = 0, ng = (1LL << 60);
    while(ng-ok > 1LL) {
        ll mid = (ok+ng) / 2LL; // mid 以上の和を持つ選び方が k 通り以上あるかな？
        int count = 0;
        for(int i=0;i<x;++i){
            if(a[i]+b[0]+c[0] < mid) break;
            for(int j=0;j<y;++j) {
                if(a[i]+b[j]+c[0] < mid) break;
                for(int l=0;l<z;++l) {
                    if(a[i]+b[j]+c[l] < mid) break;
                    ++count;
                    if(count == k) {
                        i = x; j = y; l = z;
                    }
                }
            }
        }

        if(count == k) {
            ok = mid;
        } else {
            ng = mid;
        }
    }

    vector<ll> ans;
    for(int i=0;i<x;++i){
        if(a[i]+b[0]+c[0] < ok) break;
        for(int j=0;j<y;++j) {
            if(a[i]+b[j]+c[0] < ok) break;
            for(int l=0;l<z;++l) {
                if(a[i]+b[j]+c[l] < ok) break;
                ans.push_back(a[i]+b[j]+c[l]);
            }
        }
    }
    assert(ans.size() == k);
    sort(ans.rbegin(), ans.rend());
    for(ll total: ans) {
        cout << total << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:5: error: 'assert' was not declared in this scope
   62 |     assert(ans.size() == k);
      |     ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include <algorithm>
  +++ |+#include <cassert>
    4 |
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int Z = sc.nextInt();
        int K = sc.nextInt();

        long[] A = new long[X];
        long[] B = new long[Y];
        long[] C = new long[Z];
        for (int i = 0; i < X; i++) {
            A[i] = sc.nextLong();
        }
        for (int i = 0; i < Y; i++) {
            B[i] = sc.nextLong();
        }
        for (int i = 0; i < Z; i++) {
            C[i] = sc.nextLong();
        }

        int N = X * Y * Z;
        long[] sums = new long[N];
        int cnt = 0;
        for (int i = 0; i < X; i++) {
            for (int j = 0; j < Y; j++) {
                for (int k = 0; k < Z; k++) {
                    sums[cnt] = A[i] + B[j] + C[k];
                    cnt++;
                }
            }
        }
        Arrays.sort(sums);
        for (int i = N - 1; i >= N - K ; i--) {
            System.out.println(sums[i]);
        }
    }

    // Main
    public static void main(String[] args) {
        new Main.solve();
    }

}


Compiler output:
Main.java:45: error: cannot find symbol
        new Main.solve();
                ^
  symbol:   class solve
  location: class Main
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int Z = sc.nextInt();
        int K = sc.nextInt();

        long[] A = new long[X];
        long[] B = new long[Y];
        long[] C = new long[Z];
        for (int i = 0; i < X; i++) {
            A[i] = sc.nextLong();
        }
        for (int i = 0; i < Y; i++) {
            B[i] = sc.nextLong();
        }
        for (int i = 0; i < Z; i++) {
            C[i] = sc.nextLong();
        }

        int N = X * Y * Z;
        long[] sums = new long[N];
        int cnt = 0;
        for (int i = 0; i < X; i++) {
            for (int j = 0; j < Y; j++) {
                for (int k = 0; k < Z; k++) {
                    sums[cnt] = A[i] + B[j] + C[k];
                    cnt++;
                }
            }
        }
        Arrays.sort(sums);
        for (int i = N - 1; i >= N - K ; i--) {
            System.out.println(sums[i]);
        }
    }

    // Main
    public static void main(String[] args) {
        new Main_123_D_1().solve();
    }

}


Compiler output:
Main.java:45: error: cannot find symbol
        new Main_123_D_1().solve();
            ^
  symbol:   class Main_123_D_1
  location: class Main
1 error
Language: C++

def maxAndIndex(a_buf):
    memIdx = 0
    memMax = a_buf[0] 
    for i, e in enumerate(a_buf[1:]):
        if e > memMax:
            memMax = e
            memIdx = i + 1
    return memMax, memIdx

def sub():
    lines = [input() for _ in range(4)]
    X, Y, Z, K = [int(e) for e in lines[0].split(" ")]
    As = [int(e) for e in lines[1].split(" ")]
    Bs = [int(e) for e in lines[2].split(" ")]
    Cs = [int(e) for e in lines[3].split(" ")]

    As = sorted(As, reverse=True)
    Bs = sorted(Bs, reverse=True)
    Cs = sorted(Cs, reverse=True)
    nb_A = len(As)
    nb_B = len(Bs)
    nb_C = len(Cs)
    # dv = {}
    # dv[(0,0,0)] = As[0] + Bs[0] + Cs[0]
    buf = []
    qs = [(0,0,0)]
    for i in range(K):
        vs = [As[q[0]] + Bs[q[1]] + Cs[q[2]] for q in qs]
        m, im = maxAndIndex(vs)
        # print(m)
        buf.append(m)
        qm = qs[im]
        qs = qs[:im] + qs[im+1:]
        a, b, c = qm
        if a+1 < nb_A:
            qs.append((a+1, b, c))
        if b+1 < nb_B:
            qs.append((a, b+1, c))
        if c+1 < nb_C:
            qs.append((a, b, c+1))
        qs = list(set(qs))

    buf = [str(b) for b in buf]
    print("\n".join(buf))



        

sub()


Compiler output:
a.cc:23:7: error: invalid preprocessing directive #dv
   23 |     # dv = {}
      |       ^~
a.cc:24:7: error: invalid preprocessing directive #dv
   24 |     # dv[(0,0,0)] = As[0] + Bs[0] + Cs[0]
      |       ^~
a.cc:30:11: error: invalid preprocessing directive #print
   30 |         # print(m)
      |           ^~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def maxAndIndex(a_buf):
      | ^~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#define FOR(i,a,b) for(int i=(a);i<(b);++i) 
#define REP(i,n) FOR(i,0,n)
#define EACH(x,a) for(auto& (x):(a))
#define ALL(obj) (obj).begin(),(obj).end()
#define Yes(n) cout<<((n)?"Yes":"No")<<endl;
#define CO(x) cout<<(x)<<endl;
#define COSP(x) cout<<(x)<<" ";
using namespace std;
using ll=long long;
const int INF=1e9;
const ll LINF=1e18;
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int X, Y, Z
  ll K;
  vector<ll> A, B, C;
  cin >> X >> Y >> Z >> K;
  REP(i,X){
    ll a;
    cin>>a;
    A.push_back(a);
  }
  REP(i,Y){
    ll a;
    cin>>a;
    B.push_back(a);
  }
  REP(i,Z){
    ll a;
    cin>>a;
    C.push_back(a);
  }

  vector<ll> cakeList;
  REP(i,X) REP(j,Y) REP(k,Z) cakeList.push_back(A[i]+B[j]+C[k]);
  sort(ALL(cakeList), greater<ll>());

  REP(i,K) cout<<cakeList[i]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected initializer before 'll'
   22 |   ll K;
      |   ^~
a.cc:24:20: error: 'Z' was not declared in this scope
   24 |   cin >> X >> Y >> Z >> K;
      |                    ^
a.cc:24:25: error: 'K' was not declared in this scope
   24 |   cin >> X >> Y >> Z >> K;
      |                         ^
Language: C++

#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

ll X, Y, Z, K;
ll A[1010], B[1010], C[1010];

ll D[1000100];

ll E[3010];

int main()
{
	cin >> X >> Y >> Z >> K;
	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];
	}
	//入力完了

	sort(A, A + X, greater<ll>());
	sort(B, B + Y, greater<ll>());
	sort(C, C + Z, greater<ll>());

	ll i_d = 0;

	for (ll i = 0; i < X; i++)
	{
		for (ll j = 0; j < Y; j++)
		{
			D[i_d++] = A[i] + B[j];
		}
	}

	sort(D, D + i_d, greater<ll>());

	ll i_e = 0;

	for (ll i = 0; i < K; i++)
	{
		for (ll j = 0; j < Z; j++)
		{
			E[i_e++] = D[i] + C[j];
		}
	}

	sort(E, E + i_e, greater<ll>());

	for (ll i = 0; i < K; i++)
	{
		cout << E[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   41 |         sort(A, A + X, greater<ll>());
      |         ^~~~
      |         sqrt
Language: C++

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

int main() {
  int X,Y,Z,K;
  std::cin >> X >> Y >> Z >> K;
  std::vector<unsigned long long> A(X);
  std::vector<unsigned long long> B(Y);
  std::vector<unsigned long long> C(Z);
  for(auto &a:A)
    std::cin >> a;
  for(auto &b:B)
    std::cin >> b;
  for(auto &c:C)
    std::cint >> c;

  std::sort(A.begin(),A.end(),std::greater<unsigned long long>());
  std::sort(B.begin(),B.end(),std::greater<unsigned long long>());
  std::sort(C.begin(),C.end(),std::greater<unsigned long long>());
  auto itr_a = A.begin();
  auto itr_b = B.begin();
  auto itr_c = C.begin();
  for(int i=0;i<K;i++){
    std::cout << *itr_a + *itr_b + *itr_c << std::endl;
    if(*itr_a <= *itr_b && *itr_a <= *itr_c && itr_a < A.end())
      itr_a++;
    else if(*itr_b < *itr_a && *itr_b <= *itr_c && itr_b < B.end())
      itr_b++;
    else if(*itr_c < *itr_a && *itr_c < *itr_b && itr_c < C.end())
      itr_c++;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'cint' is not a member of 'std'; did you mean 'cin'?
   16 |     std::cint >> c;
      |          ^~~~
      |          cin
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class D123 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int Z = sc.nextInt();
		int K = sc.nextInt();
		
		long[] A = new long[X];
		long[] B = new long[Y];
		long[] C = new long[Z];
		
		for(int i = 0; i < X; i++) {
			A[i] = sc.nextLong();
		}
		
		for(int i = 0; i < Y; i++) {
			B[i] = sc.nextLong();
		}
		
		for(int i = 0; i < Z; i++) {
			C[i] = sc.nextLong();
		}
		
		long[] del = new long[X * Y];
		int p = 0;
		for(int i = 0; i < X; i++) {
			for(int j = 0; j < Y; j++) {
				del[p] = A[i] + B[j];
				p++;
			}
		}
		Arrays.sort(del);
		long[] del2 = new long[Z * K];
		int x = Math.max(del.length - 1 - K, -1);
		int q = 0;
		for(int i = del.length - 1; i > x; i--) {
			for(int j = 0; j < Z; j++) {
				del2[q] = del[i] + C[j];
				q++;
			}
		}
		Arrays.sort(del2);
		for(int i = del2.length - 1; i > del2.length - 1 - K; i--) {
			System.out.println(del2[i]);
		}
	}
}


Compiler output:
Main.java:4: error: class D123 is public, should be declared in a file named D123.java
public class D123 {
       ^
1 error
Language: C++

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

const int maxn = 1010;
long long a[maxn], b[maxn], c[maxn];

int main() {
#ifdef HOME
  freopen("input.txt", "r", stdin);
#endif
  int x, y, z, k;
  cin >> x >> y >> z >>k;
  for (int i = 0; i < x; ++i) scanf("%I64d", &a[i]); sort(a, a + x, greater<long long>);
  for (int i = 0; i < y; ++i) scanf("%I64d", &b[i]); sort(b, b + y, greater<long long>);
  for (int i = 0; i < z; ++i) scanf("%I64d", &c[i]); sort(c, c + z, greater<long long>);
  int top = 0;
  vector<long long> ans;
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < y; ++j) {
      for (int k = 0; k < z; ++k)
        if ((i + 1) * (j + 1) * (k + 1) <= k) ans.push_back(a[i] + b[j] + c[k]);
        else break;
    }
  }
  sort(ans.begin(), ans.end(), greater<long long>);               
  for (int i = 0; i < k; ++i) cout << ans[i] << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:87: error: expected primary-expression before ')' token
   13 |   for (int i = 0; i < x; ++i) scanf("%I64d", &a[i]); sort(a, a + x, greater<long long>);
      |                                                                                       ^
a.cc:14:87: error: expected primary-expression before ')' token
   14 |   for (int i = 0; i < y; ++i) scanf("%I64d", &b[i]); sort(b, b + y, greater<long long>);
      |                                                                                       ^
a.cc:15:87: error: expected primary-expression before ')' token
   15 |   for (int i = 0; i < z; ++i) scanf("%I64d", &c[i]); sort(c, c + z, greater<long long>);
      |                                                                                       ^
a.cc:25:50: error: expected primary-expression before ')' token
   25 |   sort(ans.begin(), ans.end(), greater<long long>);
      |                                                  ^
Language: C++

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

int main(){
  int X, Y, Z, K;cin>>X>>Y>>Z>>K;
  vll A, B, C;
  for (int i=0;i<X;++i){ll a;cin>>a;A.push_back(a);} 
  for (int i=0;i<Y;++i){ll b;cin>>b;B.push_back(b);} 
  for (int i=0;i<Z;++i){ll c;cin>>c;C.push_back(c);}

  sort(A.begin(), A.end(), greater<ll>());
  sort(B.begin(), B.end(), greater<ll>());
  sort(C.begin(), C.end(), greater<ll>()); 
  vll D;

  for (int i=0;i<X;++i){
    for (int j=0;j<Y;++j){
      D.push_back(A[i]+B[j]);
    }
  }

  sort(D.begin(), D.end(), greater<ll>());
  vll E;

  K_=min(K, X*Y);

  for (int i=0;i<K_;++i){
    for (int j=0;j<Z;++j){
      E.push_back(D[i]+E[j]);
    }
  }

  sort(E.begin(), E.end(), greater<ll>());

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'K_' was not declared in this scope; did you mean 'K'?
   27 |   K_=min(K, X*Y);
      |   ^~
      |   K
Language: C++

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

int main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  vector<int> A(X);
  vector<int> B(Y);
  vector<int> C(Z);
  for(int i=0;i<X;i++){
    cin >> A.at(i);
  }
  for(int i=0;i<Y;i++){
    cin >> B.at(i);
  }
  for(int i=0;i<Z;i++){
    cin >> C.at(i);
  }
  vector<int> D(X*Y*Z);
  for(int i=0;i<X;i++){
    for(int j=0;j<Y;j++){
      for(int k=0;k<Z;k++){
        D.at(i+j*X+k*X*Y)=A.at(i)+B.at(j)+C.at(k);
      }
    }
  }
  for(i=0;i<x*Y*Z;i++){
    cout << D.at(i) << endl ;
  }
  //let's sort!
  int a=0;
  int b=0;
  for(int i=0;i<X*Y*Z-1;i++){
    for(int j=0;j<X*Y*Z-i-1;j++){
      a=D.at(j);
      b=D.at(j+1);
      D.at(j) = min(a,b);
      D.at(j+1) = max(a,b);
    }
  }
  //let's output
  for(int i=0;i<k;i++){
    cout << D.at(X*Y*Z-i-1) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'i' was not declared in this scope
   27 |   for(i=0;i<x*Y*Z;i++){
      |       ^
a.cc:27:13: error: 'x' was not declared in this scope
   27 |   for(i=0;i<x*Y*Z;i++){
      |             ^
a.cc:42:17: error: 'k' was not declared in this scope
   42 |   for(int i=0;i<k;i++){
      |                 ^
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>	
using namespace std;
int main() {
    int x[3],k;
    vector<vector<long>> a;
    a.assign(3,vector<long>());
    vector<long> answer;
    for (int i=0;i<3;i++){
        scanf("%d",&x[i]);
    }
    scanf("%d",&k);
    for (int i=0;i<3;i++){
        for (int j=0;j<x[i];j++){
            long tmp;
            scanf("%ld",&tmp);
            a[i].push_back(tmp);
        }
    }
    sort(a.begin(),a.end(),[](vector<long> v1, vector<long>v2) -> int { return ( v1.size() < v2.size() ); } );
    for (int i=0;i<3;i++){
        sort(a[i].begin(),a[i].end(),greater<long>());
    }
    int i0,i1,i2;
    long min = __LONG_MAX__;
    i0 = i1 = i2 = 0;
    while (i0 < a[0].size() ){
        long tmp = a[0][i0] + a[1][i1] + a[2][i2];
        if (answer.size() < k ) {
            if (tmp<min){
                min = tmp;
            }
            answer.push_back(tmp);
            i2 ++;
        } else if (min < tmp ) {
            delete find(answer.begin(),answer.end(),min);
            answer.push_back(tmp);
            min = tmp;
            i2 ++;
        } else {
            i2 = 0;
            i1 ++;
        }
        if (i2>=a[2].size()) {
            i2 = 0;
            i1 ++;
        }
        if (i1>=a[1].size()) {
            i1 = 0;
            i0 ++;
        }
    }
    sort(answer.begin(),answer.end(),greater<long>());
    for (int i=0;i<answer.size();i++){
        printf("%ld\n",answer[i]);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:24: error: type 'class __gnu_cxx::__normal_iterator<long int*, std::vector<long int> >' argument given to 'delete', expected pointer
   38 |             delete find(answer.begin(),answer.end(),min);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repb(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for(auto v:(V))cout<<v<<" "<<endl
inline int GCD(int a, int b){return b ? GCD(b, a % b) : a;}
const int MOD = 1000000007;

int main()
{
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vll a(x);
    vll b(y);
    vll c(z);
    rep(i, x)
    {
        cin >> a.at(i);
    }
    rep(i, y)
    {
        cin >> b.at(i);
    }
    rep(i, z)
    {
        cin >> c.at(i);
    }
    sort(ALL(a), greater<ll>());
    sort(ALL(b), greater<ll>());
    sort(ALL(c), greater<ll>());
    vll ans;
    ll shikii = a.at(min(x-1, 15))+b.at(min(y-1, 15))+c.at(min(z-1, 15));
    ll anstemp = 0;
    rep(p, x)
    {
        rep(q, y)
        {
            rep(r, z)
            {
                anstemp = a.at(p)+b.at(q)+c.at(r);
                if (anstemp < shikii)
                {
                    break;
                }
                ans.push_back(anstemp);
                if (ans.size%3000 == 0 && ans.size > 0)
                {
                    sort(ALL(ans), greater<ll>());
                    shikii = ans.at(2999);
                }
            }
        }
    }
    sort(ALL(ans), greater<ll>());

    rep(i, k)
    {
        cout << ans.at(i) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:25: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   55 |                 if (ans.size%3000 == 0 && ans.size > 0)
      |                     ~~~~^~~~
      |                             ()
a.cc:55:47: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   55 |                 if (ans.size%3000 == 0 && ans.size > 0)
      |                                           ~~~~^~~~
      |                                                   ()
Language: C++

#include <iostream>
#include <functional>
#include <vector>

using namespace std;

typedef long long ll;

const int MAX = 1000;

int X,Y,Z,K;
ll A[MAX],B[MAX],C[MAX];
vector<ll> T;

int main() {
    cin >> X >> Y >> Z >> K;
    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<ll>());
    sort(B, B+Y, greater<ll>());
    sort(C, C+Z, greater<ll>());

    for (int i=0; i<X; i++) {
        for (int j=0; j<Y; j++) {
            for (int k=0; k<Z; k++) {
                if ((i+1)*(j+1)*(k+1)<=K) T.push_back(A[i]+B[j]+C[k]);
                else break;
            }
        }
    }

    sort(T.begin(), T.end(), greater<ll>());
    for (int i=0; i<K; i++) cout << T[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(A, A+X, greater<ll>());
      |     ^~~~
      |     short
Language: C++

#include "bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/dynamic_bitset.hpp>

namespace adaptor = boost::adaptors;
using namespace std;

void Main()
{
   int X, Y, Z, K;
   cin >> X >> Y >> Z >> K;
   vector<int32_t> A(X), B(Y), C(Z);
   for (auto &v : A)
   {
      cin >> v;
   }
   for (auto &v : B)
   {
      cin >> v;
   }
   for (auto &v : C)
   {
      cin >> v;
   }

   vector<int32_t> AB;
   int x, y, z;
   for (x = 0; x < X; x++)
   {
      for (y = 0; y < Y; y++)
      {
         AB.push_back(A[x] + B[y]);
      }
   }
   std::sort(AB.begin(), AB.end(), std::greater<int32_t>());
   vector<int32_t> ABC;
   for (x = 0; x < K; x++)
   {
      for (z = 0; z < Z; z++)
      {
         ABC.push_back(AB[x] + C[z]);
      }
   }
   std::sort(ABC.begin(), ABC.end(), std::greater<int32_t>());
   int k = 0;
   for (z = 0; z < K; z++)
   {
      cout << ABC[z] << endl;
   }
}


Compiler output:
a.cc:2:10: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include <boost/multi_array.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int desc(const void *a, const void *b) {
   long long *A = (long long *)a;
   long long *B = (long long *)b;
   if (*A < *B) {
      return 1;
   } else if (*A > *B) {
      return -1;
   } else {
      return 0;
   }
}

long long int main(void) {
   long long int X,Y,Z,K;
   scanf("%lld %lld %lld %lld", &X, &Y, &Z, &K);
   long long int *A = (long long int *)malloc(X * sizeof(long long int));
   long long int *B = (long long int *)malloc(Y * sizeof(long long int));
   long long int *C = (long long int *)malloc(Z * sizeof(long long int));
   long long int *L = (long long int *)malloc((X*Y+1) * sizeof(long long int));
   for (long long int i = 0; i < X; i++) {
      scanf("%lld", &A[i]);
   }
   for (long long int i = 0; i < Y; i++) {
      scanf("%lld", &B[i]);
   }
   for (long long int i = 0; i < Z; i++) {
      scanf("%lld", &C[i]);
   }
   for (long long int i = 0; i < X; i++) {
      for (long long int j = 0; j < Y; j++) {
         L[i*Y+j] = A[i] + B[j];
      }
   }
   free(A);free(B);
   long long int *M = (long long int *)malloc(Z*3001 * sizeof(long long int));
   qsort(L,X * Y,sizeof (long  int), desc);
   for (long long int i = 0; i < 3001; i++) {
      for (long long int j = 0; j < Z; j++) {
         M[i*Z+j] = L[i] + C[j];
      }
   }
   qsort(M,3000*Z,sizeof (long long int), desc);
   for (long long int i = 0; i < K; i++) {
      printf("%lld\n",M[i]);
   }
   return 0;
}


Compiler output:
a.cc:17:11: error: '::main' must return 'int'
   17 | long long int main(void) {
      |           ^~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
long long int desc(const void *a, const void *b) {
   long long *A = (long long *)a;
   long long *B = (long long *)b;
   if (*A < *B) {
      return 1;
   } else if (*A > *B) {
      return -1;
   } else {
      return 0;
   }
}

long long int main(void) {
   long long int X,Y,Z,K;
   scanf("%lld %lld %lld %lld", &X, &Y, &Z, &K);
   long long int *A = (long long int *)malloc(X * sizeof(long long int));
   long long int *B = (long long int *)malloc(Y * sizeof(long long int));
   long long int *C = (long long int *)malloc(Z * sizeof(long long int));
   long long int *L = (long long int *)malloc((X*Y+1) * sizeof(long long int));
   for (long long int i = 0; i < X; i++) {
      scanf("%lld", &A[i]);
   }
   for (long long int i = 0; i < Y; i++) {
      scanf("%lld", &B[i]);
   }
   for (long long int i = 0; i < Z; i++) {
      scanf("%lld", &C[i]);
   }
   for (long long int i = 0; i < X; i++) {
      for (long long int j = 0; j < Y; j++) {
         L[i*Y+j] = A[i] + B[j];
      }
   }
   free(A);free(B);
   long long int *M = (long long int *)malloc(Z*3001 * sizeof(long long int));
   qsort(L,X * Y,sizeof (long  int), desc);
   for (long long int i = 0; i < 3001; i++) {
      for (long long int j = 0; j < Z; j++) {
         M[i*Z+j] = L[i] + C[j];
      }
   }
   qsort(M,3000*Z,sizeof (long long int), desc);
   for (long long int i = 0; i < K; i++) {
      printf("%lld\n",M[i]);
   }
   return 0;
}


Compiler output:
a.cc:17:11: error: '::main' must return 'int'
   17 | long long int main(void) {
      |           ^~~
a.cc: In function 'int main()':
a.cc:40:38: error: invalid conversion from 'long long int (*)(const void*, const void*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   40 |    qsort(L,X * Y,sizeof (long  int), desc);
      |                                      ^~~~
      |                                      |
      |                                      long long int (*)(const void*, const void*)
In file included from /usr/include/c++/14/bits/std_abs.h:38,
                 from /usr/include/c++/14/cmath:49,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:3:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
a.cc:46:43: error: invalid conversion from 'long long int (*)(const void*, const void*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   46 |    qsort(M,3000*Z,sizeof (long long int), desc);
      |                                           ^~~~
      |                                           |
      |                                           long long int (*)(const void*, const void*)
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<stdio.h>
#include <string>
#include <algorithm>
#include <iostream>
#include<cmath>
using namespace std;

const static int MAX = 1000000000;
int x, y, z, k;
long A[MAX], B[MAX], C[MAX], D[MAX], E[MAX];

int main() {
    scanf("%d %d %d %d", &x, &y, &z, &k);

    for ( int i = 0; i < x; i++ ) {
        scanf("%ld", &A[i]);
    }
    
    for ( int i = 0; i < y; i++ ) {
        scanf("%ld", &B[i]);
    }
    
    for ( int i = 0; i < z; i++ ) {
        scanf("%ld", &C[i]);
    }
    
    for ( int i = 0; i < x; i++ ) {
        for ( int j = 0; j < y; j++ ) {
            D[x*i+j] = A[i] + B[j];
        }
    }

    sort(D, D+MAX, greater<long>());

    for ( int i = 0; i < k; i++ ) {
        for ( int j = 0; j < z; j++ ) {
            E[k*i+j] = D[i] + C[j];
        }
    }

    sort(E, E+MAX, greater<long>());

    for ( int i = 0; i < k; i++ ) {
        printf("%ld\n", E[i]);
    }
    
    return 0;
}


Compiler output:
/tmp/ccCDp6Br.o: in function `main':
a.cc:(.text+0xa0): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0xe6): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x14d): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x176): relocation truncated to fit: R_X86_64_PC32 against symbol `D' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x1a9): relocation truncated to fit: R_X86_64_PC32 against symbol `D' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x1b7): relocation truncated to fit: R_X86_64_PC32 against symbol `D' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x1e5): relocation truncated to fit: R_X86_64_PC32 against symbol `D' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x1fd): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x226): relocation truncated to fit: R_X86_64_PC32 against symbol `E' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x259): relocation truncated to fit: R_X86_64_PC32 against symbol `E' defined in .bss section in /tmp/ccCDp6Br.o
a.cc:(.text+0x267): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>

/**
 Answer #1
 **/

using namespace std;

int main()
{

    cout << " a" << endl;
    long long X, Y, Z;
    long long K;
    long long A[1000], B[1000], C[1000];

    cin >> X >> Y >> Z >> K;
    for (int i = 0; i < X; ++i)
    {
        cin >> A[i];
    }
    sort(A, A + X, greater<long long>());

    for (int i = 0; i < Y; ++i)
    {
        cin >> B[i];
    }
    sort(B, B + Y, greater<long long>());

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

    std::vector<long long> AB(1000000);
    for (int i = 0; i < X; ++i)
    {
        for (int j = 0; j < Y; ++j)
        {
            AB[i * Y + j] = A[i] + B[j];
        }
    }

    sort(AB.begin(), AB.begin() + X + Y, greater<long long>());

    vector<long long> ABC(3000 * 1000);
    for (int i = 0; i < K; ++i)
    {
        for (int j = 0; j < Z; ++j)
        {
            ABC[i * Z + j] = AB[i] + C[j];
        }
    }

    sort(ABC.begin(), ABC.begin() + K * Z, greater<long long>());

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |     sort(A, A + X, greater<long long>());
      |     ^~~~
      |     short
Language: C++

#include < bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,k;
  cin >> x >> y >> z >> k;
  vector<int> a(x+1),b(y+1),c(z+1);
  for (int i=1; i<x+1; i++) cin >> a[i];
  for (int i=1; i<y+1; i++) cin >> b[i];
  for (int i=1; i<z+1; i++) cin >> c[i];
  a[0]=-100000007;
  b[0]=-100000007;
  c[0]=-100000007;
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());
  vector<int>answer(k);
  int an=x;
  int bn=y;
  int cn=z;
  answer[0] = a[an] + b[bn] + c[cn];
  for(int i=1;i<k;i++){
    if(a[an]-a[an-1] == min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      an--;
    }
    else if(b[bn]-b[bn-1]== min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      bn--;
    }
    else if(c[cn]-c[cn-1]== min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      cn--;
    }
    answer[i]=a[an] + b[bn] + c[cn];
  }
  for (int i=0; i<k; i++){
    cout << answer[i] << endl;
  }
}

Compiler output:
a.cc:1:10: fatal error:  bits/stdc++.h: No such file or directory
    1 | #include < bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include < bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,k;
  cin >> x >> y >> z >> k;
  vector<int> a(x+1),b(y+1),c(z+1);
  for (int i=1; i<x+1; i++) cin >> a[i];
  for (int i=1; i<y+1; i++) cin >> b[i];
  for (int i=1; i<z+1; i++) cin >> c[i];
  a[0]=-1e9;
  b[0]=-1e9;
  c[0]=-1e9;
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());
  vector<int>answer(k);
  int an=x;
  int bn=y;
  int cn=z;
  answer[0] = a[an] + b[bn] + c[cn];
  for(int i=1;i<k;i++){
    if(a[an]-a[an-1] == min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      an--;
    }
    else if(b[bn]-b[bn-1]== min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      bn--;
    }
    else if(c[cn]-c[cn-1]== min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
      cn--;
    }
    answer[i]=a[an] + b[bn] + c[cn];
  }
  for (int i=0; i<k; i++){
    cout << answer[i] << endl;
  }
}

Compiler output:
a.cc:1:10: fatal error:  bits/stdc++.h: No such file or directory
    1 | #include < bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <climits>
#include <tuple>
struct entry {
    std::vector<long long>::iterator a, b, c;
};
struct compare1 {
    bool operator()(const entry &x, const entry &y) const {
        return *x.a + *x.b + *x.c < *y.a + *y.b + *y.c;
    }
};
struct compare2 {
    bool operator()(const entry &x, const entry &y) const {
        return std::tie(x.a, x.b, x.c) < std::tie(y.a, y.b, y.c);
    }
};
int main() {
    int x, y, z, k;
    std::cin >> x >> y >> z >> k;
    std::vector<long long> a(x), b(y), c(z);
    for (auto &ai: a) std::cin >> ai;
    for (auto &bi: b) std::cin >> bi;
    for (auto &ci: c) std::cin >> ci;
    std::sort(a.begin(), a.end(), std::greater<>());
    std::sort(b.begin(), b.end(), std::greater<>());
    std::sort(c.begin(), c.end(), std::greater<>());
    a.push_back(LLONG_MIN / 3);
    b.push_back(LLONG_MIN / 3);
    c.push_back(LLONG_MIN / 3);
    std::priority_queue<entry, std::vector<entry>, compare1> q;
    q.push({ a.begin(), b.begin(), c.begin() });
    std::set<entry, compare2> s;
    for (int i = 0; i < k; i++) {
        entry e = q.top();
        q.pop();
        if (!s.insert(e).second) {
            i--;
            continue;
        }
        std::cout << (*e.a + *e.b + *e.c) << std::endl;
        q.push({ e.a + 1, e.b, e.c });
        q.push({ e.a, e.b + 1, e.c });
        q.push({ e.a, e.b, e.c + 1 });
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   27 |     std::sort(a.begin(), a.end(), std::greater<>());
      |          ^~~~
      |          qsort
a.cc:28:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   28 |     std::sort(b.begin(), b.end(), std::greater<>());
      |          ^~~~
      |          qsort
a.cc:29:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   29 |     std::sort(c.begin(), c.end(), std::greater<>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <climits>
struct entry {
    std::vector<long long>::iterator a, b, c;
};
struct compare1 {
    bool operator()(const entry &x, const entry &y) const {
        return *x.a + *x.b + *x.c < *y.a + *y.b + *y.c;
    }
};
struct compare2 {
    bool operator()(const entry &x, const entry &y) const {
        return std::tie(x.a, x.b, x.c) < std::tie(y.a, y.b, y.c);
    }
};
int main() {
    int x, y, z, k;
    std::cin >> x >> y >> z >> k;
    std::vector<long long> a(x), b(y), c(z);
    for (auto &ai: a) std::cin >> ai;
    for (auto &bi: b) std::cin >> bi;
    for (auto &ci: c) std::cin >> ci;
    std::sort(a.begin(), a.end(), std::greater<>());
    std::sort(b.begin(), b.end(), std::greater<>());
    std::sort(c.begin(), c.end(), std::greater<>());
    a.push_back(-9999);
    b.push_back(-9999);
    c.push_back(-9999);
    std::priority_queue<entry, std::vector<entry>, compare1> q;
    q.push({ a.begin(), b.begin(), c.begin() });
    std::set<entry, compare2> s;
    for (int i = 0; i < k; i++) {
        entry e = q.top();
        q.pop();
        if (!s.insert(e).second) {
            i--;
            continue;
        }
        std::cout << (*e.a + *e.b + *e.c) << std::endl;
        q.push({ e.a + 1, e.b, e.c });
        q.push({ e.a, e.b + 1, e.c });
        q.push({ e.a, e.b, e.c + 1 });
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   26 |     std::sort(a.begin(), a.end(), std::greater<>());
      |          ^~~~
      |          qsort
a.cc:27:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   27 |     std::sort(b.begin(), b.end(), std::greater<>());
      |          ^~~~
      |          qsort
a.cc:28:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   28 |     std::sort(c.begin(), c.end(), std::greater<>());
      |          ^~~~
      |          qsort
Language: C++

#include < bits/stdc++.h>
using namespace std;
int main(){
  int x,y,z,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());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());
  vector<int>answer(k);
  int an=x-1;
  int bn=y-1;
  int cn=z-1;
  answer[0] = a[an] + b[bn] + c[cn];
  for(int i=1;i<k;i++){
    if(an!=0){
      if(a[an]-a[an-1] == min(min(b[bn]-b[bn-1], c[cn]-c[cn-1]), a[an]-a[an-1])){
        an--;
      }
     
  }

Compiler output:
a.cc:1:10: fatal error:  bits/stdc++.h: No such file or directory
    1 | #include < bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define yes(i) cout<<(i?"yes":"no")<<endl
using namespace std;
int main(){
	long long x,y,z,k
	cin>>x>>y>>z>>k;
	vector<long long> 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];
	}
	vector<long long> xy;
	for(int i=0;i<x;i++){
		for(int j=0;j<y;j++){
			xy.push_back(a[i]+b[i]);
		}
	}
	sort(xy.rbegin(),xy.rend());
	vector<long long> ans;
	for(int i=0;i<k;i++){
		for(int j=0;j<z;j++){
			ans.push_back(xy[i]+c[j]);
		}
	}
	sort(ans.rbegin(),ans.rend());
	for(int i=0;i<k;i++){
		cout<<ans[i]<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'cin'
    8 |         cin>>x>>y>>z>>k;
      |         ^~~
a.cc:27:23: error: 'k' was not declared in this scope
   27 |         for(int i=0;i<k;i++){
      |                       ^
a.cc:33:23: error: 'k' was not declared in this scope
   33 |         for(int i=0;i<k;i++){
      |                       ^
Language: Java

package atcoder.beginner.ABC123;

import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class ABC123D {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int y = sc.nextInt();
    int z = sc.nextInt();
    int k = sc.nextInt();
    Long[] a = new Long[x];
    Long[] b = new Long[y];
    Long[] c = new Long[z];
    for (int i = 0; i < x; i++) {
      a[i] = sc.nextLong();
    }
    for (int i = 0; i < y; i++) {
      b[i] = sc.nextLong();
    }
    for (int i = 0; i < z; i++) {
      c[i] = sc.nextLong();
    }
    ABC123D abc123D = new ABC123D();
    for (long i : abc123D.solve(a, b, c, k)) {
      System.out.println(i);
    }
  }

  public List<Long> solve(Long[] a, Long[] b, Long[] c, int k) {
    Arrays.sort(a, Comparator.reverseOrder());
    Arrays.sort(b, Comparator.reverseOrder());
    Arrays.sort(c, Comparator.reverseOrder());
    List<Long> list1 = new LinkedList<>();
    List<Long> list2 = new LinkedList<>();
    for (int i = 0; i < Math.min(a.length, k); i++) {
      for (int j = 0; j < Math.min(b.length, k); j++) {
        list1.add(a[i] + b[j]);
      }
    }
    list1.sort(Comparator.reverseOrder());
    for (int i = 0; i < Math.min(list1.size(), k); i++) {
      for (int j = 0; j < Math.min(c.length, k); j++) {
        list2.add(list1.get(i) + c[j]);
      }
    }
    list2.sort(Comparator.reverseOrder());
    return list2.subList(0, k);
  }
}


Compiler output:
Main.java:9: error: class ABC123D is public, should be declared in a file named ABC123D.java
public class ABC123D {
       ^
1 error