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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/*Atcoder用
 * 		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");
		int a = Integer.parseInt(tmp[0]);
		int b = Integer.parseInt(tmp[1]);
		int c = Integer.parseInt(tmp[2]);


		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String get = br.readLine();
		char[] s = get.toCharArray();
		for(char c:s)System.out.println(c);

		List<Integer> ls = new ArrayList<Integer>();
		String[] tmp = br.readLine().split(" ");
		for (int n = 0; n < N; n++) {
			ls.add(Integer.parseInt(tmp[n]));
		}
 */

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmp = br.readLine().split(" ");
		int X = Integer.parseInt(tmp[0]);
		int Y = Integer.parseInt(tmp[1]);
		int Z = Integer.parseInt(tmp[2]);
		int K = Integer.parseInt(tmp[3]);

		List<Long> A = new ArrayList<Long>();
		List<Long> B = new ArrayList<Long>();
		List<Long> C = new ArrayList<Long>();


		tmp = br.readLine().split(" ");
		for(int a = 0;a<X;a++)A.add(Long.valueOf(tmp[a]));

		tmp = br.readLine().split(" ");
		for(int a = 0;a<Y;a++)B.add(Long.valueOf(tmp[a]));

		tmp = br.readLine().split(" ");
		for(int a = 0;a<Z;a++)C.add(Long.valueOf(tmp[a]));

		Collections.sort(A,Comparator.reverseOrder());
		Collections.sort(B,Comparator.reverseOrder());
		int roop = Math.min(A.size(), Math.min(B.size(),C.size()));
		List<Long> result = new ArrayList<Long>();

		for(int x = 0;x<roop;x++){
			for(int y = 0;y<roop;y++){
				for(int z = 0;z<roop;z++){
					if(x*y*z>K)break;
					result.add(A.get(x) + B.get(y) + C.get(z));
				}
			}
		}

		Collections.sort(result,Comparator.reverseOrder());

		for(int i = 0;i<K;i++){
			System.out.println(result.get(i));
		}

	}

Compiler output:
Main.java:73: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define ll long long
//map<key,value>

int main(){
  int x,y,z,k;
  cin >> x >> y >> z >> k;
	ll a[x],b[y],c[z];
	vector<ll> ans(x*y*z,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];

  ll rank=0;
	for(int i=0;i<x;i++){
		for(int j=0;j<y;j++){
			for(int l=0;l<z;l++){
				ans[rank] = a[i]+b[j]+c[l];
				rank++:
			}
		}
	}
	sort(ALL(ans));
	for(int i=x*y*z-1;i>x*y*z-1-k;i--){
		cout << ans[i] << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:39: error: expected ';' before ':' token
   21 |                                 rank++:
      |                                       ^
      |                                       ;
Language: C

#include<stdio.h>
#include<stdlib.h>
int compare_long(const void *a, const void *b){
	long *A = (long*)a;
	long *B = (long*)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}
int main(){
	long x,y,z,k;
	scanf("%ld %ld %ld %ld",&x,&y,&z,&k);
	long* a = (long*)malloc(x*sizeof(long));
	long* b = (long*)malloc(y*sizeof(long));
	long* c = (long*)malloc(z*sizeof(long));
	long* ab = (long*)malloc(x*y*sizeof(long));
	long* abc = (long*)malloc(k*z*sizeof(long));
	long i,j;
	for(i=0;i<x;i++)	scanf("%ld",&a[i]);
	for(i=0;i<y;i++)	scanf("%ld",&b[i]);
	for(i=0;i<z;i++)	scanf("%ld",&c[i]);
	for(i=0;i<x;i++){
		for(j=0;j<y;j++){
			ab[i*y+j] = a[i] + b[j];
		} 
	}
	long xy = x*y;
	qsort(ab,xy,sizeof(long),compare_long);
	long sub = (xy <= k)? xy:k;
	for(i=0;i<sub;i++){
		for(j=0;j<z;j++){
			abc[i*z+j] = ab[i] + c[j];
		}
	}
	qsort(abc,k*z,sizeof(long),compare_long);
	for(i=0;i<k;i++)	prlongf("%ld\n",abc[i]);
	free(a);
	free(b);
	free(c);
	free(ab);
	free(abc);
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:36:33: error: implicit declaration of function 'prlongf' [-Wimplicit-function-declaration]
   36 |         for(i=0;i<k;i++)        prlongf("%ld\n",abc[i]);
      |                                 ^~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
long compare_long(const void *a, const void *b){
	return *(long*)b - *(long*)a;
}
int main(){
	long x,y,z,k;
	scanf("%ld %ld %ld %ld",&x,&y,&z,&k);
	long* a = (long*)malloc(x*sizeof(long));
	long* b = (long*)malloc(y*sizeof(long));
	long* c = (long*)malloc(z*sizeof(long));
	long* ab = (long*)malloc(x*y*sizeof(long));
	long* abc = (long*)malloc(k*z*sizeof(long));
	long i,j;
	for(i=0;i<x;i++)	scanf("%d",&a[i]);
	for(i=0;i<y;i++)	scanf("%d",&b[i]);
	for(i=0;i<z;i++)	scanf("%d",&c[i]);
	for(i=0;i<x;i++){
		for(j=0;j<y;j++){
			ab[i*y+j] = a[i] + b[j];
		} 
	}
	long xy = x*y;
	qsort(ab,xy,sizeof(long),compare_long);
	long sub = (xy <= k)? xy:k;
	for(i=0;i<sub;i++){
		for(j=0;j<z;j++){
			abc[i*z+j] = ab[i] + c[j];
		}
	}
	qsort(abc,k*z,sizeof(long),compare_long);
	for(i=0;i<k;i++)	prlongf("%ld\n",abc[i]);
	free(a);
	free(b);
	free(c);
	free(ab);
	free(abc);
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:24:34: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   24 |         qsort(ab,xy,sizeof(long),compare_long);
      |                                  ^~~~~~~~~~~~
      |                                  |
      |                                  long int (*)(const void *, const void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:31:36: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   31 |         qsort(abc,k*z,sizeof(long),compare_long);
      |                                    ^~~~~~~~~~~~
      |                                    |
      |                                    long int (*)(const void *, const void *)
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:32:33: error: implicit declaration of function 'prlongf' [-Wimplicit-function-declaration]
   32 |         for(i=0;i<k;i++)        prlongf("%ld\n",abc[i]);
      |                                 ^~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
long compare_long(const void *a, const void *b){
	return *(long*)b - *(long*)a;
}
int main(){
	long x,y,z,k;
	scanf("%d %d %d %d",&x,&y,&z,&k);
	long* a = (long*)malloc(x*sizeof(long));
	long* b = (long*)malloc(y*sizeof(long));
	long* c = (long*)malloc(z*sizeof(long));
	long* ab = (long*)malloc(x*y*sizeof(long));
	long* abc = (long*)malloc(k*z*sizeof(long));
	long i,j;
	for(i=0;i<x;i++)	scanf("%d",&a[i]);
	for(i=0;i<y;i++)	scanf("%d",&b[i]);
	for(i=0;i<z;i++)	scanf("%d",&c[i]);
	for(i=0;i<x;i++){
		for(j=0;j<y;j++){
			ab[i*y+j] = a[i] + b[j];
		} 
	}
	long xy = x*y;
	qsort(ab,xy,sizeof(long),compare_long);
	long sub = (xy <= k)? xy:k;
	for(i=0;i<sub;i++){
		for(j=0;j<z;j++){
			abc[i*z+j] = ab[i] + c[j];
		}
	}
	qsort(abc,k*z,sizeof(long),compare_long);
	for(i=0;i<k;i++)	prlongf("%ld\n",abc[i]);
	free(a);
	free(b);
	free(c);
	free(ab);
	free(abc);
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:24:34: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   24 |         qsort(ab,xy,sizeof(long),compare_long);
      |                                  ^~~~~~~~~~~~
      |                                  |
      |                                  long int (*)(const void *, const void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:31:36: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   31 |         qsort(abc,k*z,sizeof(long),compare_long);
      |                                    ^~~~~~~~~~~~
      |                                    |
      |                                    long int (*)(const void *, const void *)
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'long int (*)(const void *, const void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:32:33: error: implicit declaration of function 'prlongf' [-Wimplicit-function-declaration]
   32 |         for(i=0;i<k;i++)        prlongf("%ld\n",abc[i]);
      |                                 ^~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<long long> a(X);
  vector<long long> b(Y);
  vector<long long> 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<long long> d(K);
  vector<long long> cand;
  
  int count = 1;
  int i=X-1;
  int j=Y-1;
  int k=Z-1;
  
  int i_flag = 0;
  int j_flag = 0;
  int k_flag = 0;
  
  d[0] == a[i] + b[j] + c[k];
  while(1){
    if(count == (K-1)){
      break;
    }
    
    long long tmp_1 = a[i-1] + b[j] + c[k];
    long long tmp_2 = a[i] + b[j-1] + c[k];
    long long tmp_3 = a[i] + b[j] + c[k-1];
    
    cand.push_back(tmp_1);
    cand.push_back(tmp_2);
    cand.push_back(tmp_3);
    
    vector<long long>::iterator iter = max_element(cand.begin(), cand.end());
    
    d[count] = *iter;
    
    cand.erase(iter);
    
    count++;
    
    if((tmp_1 >= tmp_2) && (tmp_1 >= tmp3)){
      i--;
    }
    else if((tmp_2 >= tmp_1) && (tmp_2 >= tmp3)){
      j--;
  	}
    else if((tmp_3 >= tmp_1) && (tmp_3 >= tmp2)){
      k--;
    }
  }
  
  int l=0;
  while(1){
    if(l==K){
      break;
    }
    cout << d[l] << endl;
    l++;
  }
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:62:38: error: 'tmp3' was not declared in this scope; did you mean 'tmp_3'?
   62 |     if((tmp_1 >= tmp_2) && (tmp_1 >= tmp3)){
      |                                      ^~~~
      |                                      tmp_3
a.cc:68:43: error: 'tmp2' was not declared in this scope; did you mean 'tmp_2'?
   68 |     else if((tmp_3 >= tmp_1) && (tmp_3 >= tmp2)){
      |                                           ^~~~
      |                                           tmp_2
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<long long> a(X);
  vector<long long> b(Y);
  vector<long long> 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<long long> d(K);
  vector<long long> cand;
  
  int count = 1;
  int i=X-1;
  int j=Y-1;
  int k=Z-1;
  
  int i_flag = 0;
  int j_flag = 0;
  int k_flag = 0;
  
  d[0] == a[i] + b[j] + c[k];
  while(1){
    if(count == (K-1)){
      break;
    }
    
    long long tmp_1 = a[i-1] + b[j] + c[k];
    long long tmp_2 = a[i] + b[j-1] + c[k];
    long long tmp_3 = a[i] + b[j] + c[k-1];
    
    cand.push_back(tmp_1);
    cand.push_back(tmp_2);
    cand.push_back(tmp_3);
    
    vector<long long>::iterator iter = max_element(cand.begin(), cand.end());
    
    d[count] = *iter;
    
    cand.erase(iter);
    
    count++;
    
    if((tmp_1 >= tmp_2) && (tmp_1 >= tmp3)){
      i--;
    }
    else if((tmp_2 >= tmp_1) && (tmp_2 >= tmp3)){
      j--;
  	}
    else if((tmp_3 >= tmp_1) && (tmp_3 >= tmp2){
      k--;
    }
  
  int l=0;
  while(1){
    if(l==K){
      break;
    }
    cout << d[l] << endl;
    l++;
  }
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:62:38: error: 'tmp3' was not declared in this scope; did you mean 'tmp_3'?
   62 |     if((tmp_1 >= tmp_2) && (tmp_1 >= tmp3)){
      |                                      ^~~~
      |                                      tmp_3
a.cc:68:43: error: 'tmp2' was not declared in this scope; did you mean 'tmp_2'?
   68 |     else if((tmp_3 >= tmp_1) && (tmp_3 >= tmp2){
      |                                           ^~~~
      |                                           tmp_2
a.cc:72:10: error: expected ')' before ';' token
   72 |   int l=0;
      |          ^
      |          )
a.cc:68:12: note: to match this '('
   68 |     else if((tmp_3 >= tmp_1) && (tmp_3 >= tmp2){
      |            ^
a.cc:74:8: error: 'l' was not declared in this scope
   74 |     if(l==K){
      |        ^
a.cc:77:15: error: 'l' was not declared in this scope
   77 |     cout << d[l] << endl;
      |               ^
a.cc:80:2: error: expected '}' at end of input
   80 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<long long> a(X);
  vector<long long> b(Y);
  vector<long long> 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<long long> d(K);
  vector<long long) cand;
  
  int count = 0;
  int i=X-1;
  int j=Y-1;
  int k=Z-1;
  
  d[count] = a[i] + b[j] + c[k];
  
  while(1){
    count++; 
    
    cand.push_back(a[i] + b[j] + c[k-1]);
    cand.push_back(a[i] + b[j-1] + c[k]);
    cand.push_back(a[i-1] + b[j] + c[k]);
    
    vector<long long>::iterator iter = max_element(cand.begin(), cand.end());
    
    d[count] = *iter;
    
    cand.erase(iter);
    if(count == K){
      break;
    }
  }
  
  int l=0;
  while(1){
    if(l==K){
      break;
    }
    cout << d[l] << endl;
    l++;
  }
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: template argument 1 is invalid
   29 |   vector<long long) cand;
      |               ^~~~
a.cc:29:15: error: template argument 2 is invalid
a.cc:29:19: error: expected unqualified-id before ')' token
   29 |   vector<long long) cand;
      |                   ^
a.cc:41:5: error: 'cand' was not declared in this scope; did you mean 'rand'?
   41 |     cand.push_back(a[i] + b[j] + c[k-1]);
      |     ^~~~
      |     rand
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<long long> a(X);
  vector<long long> b(Y);
  vector<long long> 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<long long> d(K);
  vector<long long) cand;
  
  int count = 0;
  int i=X-1;
  int j=Y-1;
  int k=Z-1;
  
  d[count] = a[i] + b[j] + c[k];
  
  while(1){
    count++; 
    
    cand.push_back(a[i] + b[j] + c[k-1]);
    cand.push_back(a[i] + b[j-1] + c[k]);
    cand.push_back(a[i-1] + b[j] + c[k]);
    
    vector<long long>::iterator iter = max_element(cand.begin(), cand.end());
    
    d[count] = *iter;
    
    cand.erase(iter);
    if(count == K){
      break;
    }
  }
  
  sort(d.begin(),d.end());
  int l=K-1;
  while(1){
    cout << d[l] << endl;
    if(l==0){
      break;
    }
  }
}
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:29:15: error: template argument 1 is invalid
   29 |   vector<long long) cand;
      |               ^~~~
a.cc:29:15: error: template argument 2 is invalid
a.cc:29:19: error: expected unqualified-id before ')' token
   29 |   vector<long long) cand;
      |                   ^
a.cc:41:5: error: 'cand' was not declared in this scope; did you mean 'rand'?
   41 |     cand.push_back(a[i] + b[j] + c[k-1]);
      |     ^~~~
      |     rand
Language: C++

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

using ll = long long;

int main() {
	ll X, Y, Z;
	int 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];
	
	priority_queue<ll, vector<ll> > que;
	for(const auto &a : A) {
		for(const auto &b : B) {
			que.push(a + b);
		}
	}
	
	int k = K;
	vector<ll> ans;
	while(k-- && !q.empty()) {
		ll g = q.top(); q.pop();
		for(const auto &c : C) {
			ans.push_back(g + c);
		}
	}
	sort(ans.begin(), ans.end(), greater<ll>());
	
	for(int i = 0; i < K; ++i) {
		cout << ans[i] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: 'q' was not declared in this scope
   27 |         while(k-- && !q.empty()) {
      |                       ^
Language: C++

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

using ll = long long;

int main() {
	ll X. Y, Z;
	int 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];
	
	priority_queue<ll, vector<ll> > que;
	for(const auto &a : A) {
		for(const auto &b : B) {
			que.push(a + b);
		}
	}
	
	int k = K;
	vector<ll> ans;
	while(k-- && !q.empty()) {
		ll g = q.top(); q.pop();
		for(const auto &c : C) {
			ans.push_back(g + c);
		}
	}
	sort(ans.begin(), ans.end(), greater<ll>());
	
	for(int i = 0; i < K; ++i) {
		cout << ans[i] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected initializer before '.' token
   10 |         ll X. Y, Z;
      |             ^
a.cc:12:16: error: 'X' was not declared in this scope
   12 |         cin >> X >> Y >> Z >> K;
      |                ^
a.cc:12:21: error: 'Y' was not declared in this scope
   12 |         cin >> X >> Y >> Z >> K;
      |                     ^
a.cc:12:26: error: 'Z' was not declared in this scope
   12 |         cin >> X >> Y >> Z >> K;
      |                          ^
a.cc:27:23: error: 'q' was not declared in this scope
   27 |         while(k-- && !q.empty()) {
      |                       ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    int X, Y, Z, K;
    cin >> X >> Y >> Z >> K;
    long A[X], B[Y], C[Z];
    long A_and_B[K], result[K];
    for (int i=0; i<K; i++) { A_and_B[i] = 0; result[i] = 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];

    for (int i=0; i<X; i++) {
        for (int j=0; j<Y; j++) {
            A_and_B[K-1] = max(A_and_B[K-1], A[i]+B[j]);
            sort(A_and_B, A_and_B+K, greater<>());
        }
    }

    for (int i=0; i<K; i++) { 
        for (int j=0; j<Z; j++) {
            result[K-1] = max(result[K-1], A_and_B[i]+C[j]);
            sort(result, result+K, greater<>());
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |             sort(A_and_B, A_and_B+K, greater<>());
      |             ^~~~
      |             short
a.cc:24:13: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |             sort(result, result+K, greater<>());
      |             ^~~~
      |             short
Language: C++

#include <iostream> 
#include <vector> 
#include <algorithm> 
#include <string> 
using namespace::std; 
// 参考にした記事 
//https://qiita.com/drken/items/44c60118ab3703f7727f struct Heap { 	vector<int> heap; 	Heap(){} 	void push(int v) { 		heap.push_back(v); 		int i = (int)heap.size() - 1; 		while (i > 0) { 			int p = (i - 1) / 2; 			if (heap[p] >= v) break; 			heap[i] = heap[p]; 			i = p; 		} 		heap[i] = v; 	} 	int top() { 		if (!heap.empty()) return heap[0]; 		else return -1; 	} 	void pop() { 		if (heap.empty()) return; 		int v = heap.back(); 		heap.pop_back(); 		int i = 0; 		while (i * 2 + 1 < (int)heap.size()) { 			int child1 = i * 2 + 1; 			int child2 = i * 2 + 2; 			if (child2 < (int)heap.size() && heap[child2] > heap[child1]) child1 = child2; 			if (heap[child1] <= v) break; 			heap[i] = heap[child1]; 			i = child1; 		} 		heap[i] = v; 	} }; 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 < A.size(); i++) { 		int temp; cin >> temp; 		A.push_back(temp); 	} 	for (int i = 0; i < B.size(); i++) { 		int temp; cin >> temp; 		B.push_back(temp); 	} 	for (int i = 0; i < C.size(); i++) { 		int temp; cin >> temp; 		C.push_back(temp); 	} 	Heap h;	 	for (int a = 0; a < A.size(); a++) { 		for (int b = 0; b < B.size(); b++) { 			for (int c = 0; c < C.size(); c++) { 				h.push(a + b + c); 			} 		} 	} 	for (int i = 0; i < K; i++) { 		cout << h.top() << endl; 		h.pop(); 	} 	return 0; }


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

    import java.util.*;
         
    public class Main {
        
        private List<Long> tasteList;
        private int k = 0;
         
        public static void main(String[] args) {
            Main m = new Main();
            m.read();
            m.exec();
        }
         
        private void read() {
            Scanner scan = new Scanner(System.in);
            int x = scan.nextInt();
            int y = scan.nextInt();
            int z = scan.nextInt();
            k = scan.nextInt();
            List<Long> xList = new ArrayList<Long>();
            for (int i = 0; i < x; i++) {
                xList.add(scan.nextLong());
            }
            List<Long> yList = new ArrayList<Long>();
            for (int i = 0; i < y; i++) {
                yList.add(scan.nextLong());
            }
            List<Long> zList = new ArrayList<Long>();
            for (int i = 0; i < z; i++) {
                zList.add(scan.nextLong());
            }
            tasteList = new ArrayList<Long>();
            for (long l : xList) {
                for (long m : yList) {
                    for (long n : zList) {
                        tasteList.add(l + m + n);
                    }
                }
            }
        }
         
        private void exec() {
            Collections.sort(tasteList);
            for (int i = 1; i <= k; i++) {
                 System.out.println(String.valueOf(tasteList.get(tasteList.sise() - i)));
            }
        }
    }

Compiler output:
Main.java:45: error: cannot find symbol
                 System.out.println(String.valueOf(tasteList.get(tasteList.sise() - i)));
                                                                          ^
  symbol:   method sise()
  location: variable tasteList of type List<Long>
1 error
Language: C++

#include<iostream>
#include<algorithm>
#include<assert.h>
using namespace std;

long long t[2000000000];
int ti=0;

int main(){
	long long x,y,z,k;
	cin>>x>>y>>z>>k;
	long long a[x],b[y],c[z];
	for(long long i=0;i<x;++i)
		cin>>a[i];
	for(long long i=0;i<y;++i)
		cin>>b[i];
	for(long long i=0;i<z;++i)
		cin>>c[i];
	sort(a,a+x,greater<long long>());
	sort(b,b+y,greater<long long>());
	sort(c,c+z,greater<long long>());

	for(long long i=0;i<x;++i)
		for(long long j=0;j<y;++j)
			for(long long l=0;l<z;++l){
				if((i+1)*(j+1)*(l+1)<=k){
					t[ti]=a[i]+b[j]+c[l];
					++ti;
					continue;
				}
				else
				break;
			}
	sort(t,t+ti,greater<long long>());
	for(long long i=0;i<k;++i)
		cout<<t[i]<<endl;
	return 0;
}

Compiler output:
/tmp/cclfBcPj.o: in function `main':
a.cc:(.text+0x2ea): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cclfBcPj.o
a.cc:(.text+0x308): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cclfBcPj.o
a.cc:(.text+0x311): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cclfBcPj.o
a.cc:(.text+0x35a): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cclfBcPj.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<assert.h>
using namespace std;

	long long t[1000000009],ti=0;

int main(){
	long long x,y,z,k;
	cin>>x>>y>>z>>k;
	long long a[x],b[y],c[z];
	for(long long i=0;i<x;++i)
		cin>>a[i];
	for(long long i=0;i<y;++i)
		cin>>b[i];
	for(long long i=0;i<z;++i)
		cin>>c[i];
	sort(a,a+x,greater<long long>());
	sort(b,b+y,greater<long long>());
	sort(c,c+z,greater<long long>());

	for(long long i=0;i<x;++i)
		for(long long j=0;j<y;++j)
			for(long long l=0;l<z;++l){
				if((i+1)*(j+1)*(l+1)<=k){
					t[ti]=a[i]+b[j]+c[l];
					++ti;
					continue;
				}
				else
				break;
			}
	sort(t,t+ti,greater<long long>());
	for(long long i=0;i<k;++i)
		cout<<t[i]<<endl;
	return 0;
}

Compiler output:
/tmp/cchEUVWJ.o: in function `main':
a.cc:(.text+0x2eb): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cchEUVWJ.o
a.cc:(.text+0x308): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cchEUVWJ.o
a.cc:(.text+0x313): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cchEUVWJ.o
a.cc:(.text+0x35d): relocation truncated to fit: R_X86_64_PC32 against symbol `ti' defined in .bss section in /tmp/cchEUVWJ.o
collect2: error: ld returned 1 exit status
Language: C++

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

int x, y, z, k;
long long a[1000], b[1000], c[1000];

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), reverse(a, a+x);
  sort(b, b+y), reverse(b, b+y);
  sort(c, c+z), reverse(c, c+z);
  
  for (int i = 0; i < x; ++i) for (int j = 0; j < y; ++j) if ((i+1) * (j+1) <= k)
    for (int l = 0; l < z; ++l) if ((i+1) * (j+1) * (l+1) <= k)
      v.push_back(a[i] + b[j] + c[l]);
  
  for (int i = 0; i < k; ++i) cout << v[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'v' was not declared in this scope
   19 |       v.push_back(a[i] + b[j] + c[l]);
      |       ^
a.cc:21:39: error: 'v' was not declared in this scope
   21 |   for (int i = 0; i < k; ++i) cout << v[i] << endl;
      |                                       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int x, y, z, K;

int main() {
  cin >> x >> y >> z >> K;
  vector<long long> X, Y, Z;
  for (int i = 0; i < x; i++) {
    int a;
    cin >> a;
    X.push_back(a);
  }
  for (int i = 0; i < y; i++) {
    int a;
    cin >> a;
    Y.push_back(a);
  }
  for (int i = 0; i < z; i++) {
    int a;
    cin >> a;
    Z.push_back(a);
  }
  sort(X.rbegin(), X.rend());
  sort(Y.rbegin(), Y.rend());
  sort(Z.rbegin(), Z.rend());
  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(X[i] + Y[j] + Z[k]);
        } else  break;
      }
    }
  }
  sort(ans.rbegin(), ans.rend());
  for (int i = 0; i < k; i++) {
    cout << ans[i] << '\n';
  }
}


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

#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <thread>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)

using namespace std;

int count_upper(uint64_t v, vector<uint64_t>& as, vector<uint64_t>& bs, vector<uint64_t>& cs, int x, int y, int z, int k)
{
	int count = 0;

	FOR_LT(a, 0, x) {
		FOR_LT(b, 0, y) {
			FOR_LT(c, 0, z) {
				if (as[a] + bs[b] + cs[c] < v) break;

				count++;
				if (k < count) return count;
			}
		}
	}

	return count;
}

int main()
{
	int x, y, z, k; cin >> x >> y >> z >> k;

	vector<uint64_t> as(x);
	vector<uint64_t> bs(y);
	vector<uint64_t> cs(z);
	for (auto &a : as) {
		cin >> a;
	}
	for (auto &b : bs) {
		cin >> b;
	}
	for (auto &c : cs) {
		cin >> c;
	}

	sort(as.begin(), as.end(), greater<uint64_t>());
	sort(bs.begin(), bs.end(), greater<uint64_t>());
	sort(cs.begin(), cs.end(), greater<uint64_t>());

	uint64_t h = as.front() + bs.front() + cs.front();
	uint64_t l = as.back() + bs.back() + cs.back();
	uint64_t h_n = 1;
	uint64_t l_n = x * y * z;

	vector<uint64_t> vals;
	while(true) {
		if (h == l) break;
		uint64_t m = (h + l) / 2;

		int count = count_upper(m, as, bs, cs, x, y, z, k);
		if (count == k) {
			h = l = m;
			break;
		}
		else if (count < k) {
			h = m;
		}
		else {
			l = m + 1;
		}
	}

	vector<uint64_t> vals(k + 1000 + 1000);
	{
		int count = 0;
		FOR_LT(a, 0, x) {
			FOR_LT(b, 0, y) {
				FOR_LT(c, 0, z) {
					if (as[a] + bs[b] + cs[c] < l) break;

					vals[count] = as[a] + bs[b] + cs[c];
					count++;
				}
			}
		}
	}

	sort(vals.begin(), vals.end());
	int count = 0;
	for (auto it = vals.rbegin(); it != vals.rend(); it++) {
		cout << *it << endl;
		count++;
		if (count == k) break;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:91:26: error: redeclaration of 'std::vector<long unsigned int> vals'
   91 |         vector<uint64_t> vals(k + 1000 + 1000);
      |                          ^~~~
a.cc:73:26: note: 'std::vector<long unsigned int> vals' previously declared here
   73 |         vector<uint64_t> vals;
      |                          ^~~~
Language: C++

#include<bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
typedef long long ll;
const int maxn=1e3+233;
const int maxl=1e6+233;
ll x,y,z,k;
ll a[maxn],b[maxn],c[maxn],d[maxl];
vector<ll>ans;
bool cmp(ll u,ll v){
	return u>v;
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>x>>y>>z>>k;
	for(int i=1;i<=x;i++)cin>>a[i];
	for(int i=1;i<=y;i++)cin>>b[i];
	for(int i=1;i<=z;i++)cin>>c[i];
	ll sz=0;
	for(int i=1;i<=x;i++){
		for(int j=1;j<=y;j++){
			d[++sz]=a[i]+b[j];
		}
	}
	sort(d+1,d+sz+1,cmp);
	sort(c+1,c+1+z,cmp);
	for(int r=1;r<=max(3000,sz);r++){
		for(int i=1;i<=z;i++){
			ans.pb(d[r]+c[i]);
		}
	}
	sort(ans.begin(),ans.end(),cmp);
	for(int i=0;i<k;i++)cout<<ans[i]<<"\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: no matching function for call to 'max(int, ll&)'
   30 |         for(int r=1;r<=max(3000,sz);r++){
      |                        ~~~^~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:30:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   30 |         for(int r=1;r<=max(3000,sz);r++){
      |                        ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:30:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |         for(int r=1;r<=max(3000,sz);r++){
      |                        ~~~^~~~~~~~~
Language: Java

//解けなかった
import java.util.*;

public class Main{
  public static void main(String args[]) {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    long[] a = new int[Long.parselong(br.readLine())];
    long[] b = new int[Long.parselong(br.readLine())];
    long[] c = new int[Long.parselong(br.readLine())];
    int n = Integer.parseInt(br.readLine());
      
    for (int i = 0; i < a.length; i++) {
      a[i] = Long.parselong(br.readLine());
    }
    for (int i = 0; i < b.length; i++) {
      b[i] = Long.parselong(br.readLine());
    }
    for (int i = 0; i < c.length; i++) {
      c[i] = Long.parselong(br.readLine());
    }
       
    /*Arrays.sort(a);
    Arrays.sort(b);
    Arrays.sort(c);*/
    
    int[] sums = a.length * b.length * c.length;
    String[] str = new String[sums.length];
    for (int i = 1; i < a.length + 1; i++) {
      for (int j = 1; j < b.length + 1; j++) {
        for (int k = 1; k < c.length + 1; k++) {
            sums[i+j+k] = a[i] + b[j] + c[k];
            str = String.valueOf(sums[i+j+k]);
        }
      }
    }
    
    //Arrays.sort(sums);
    List list = Arrays.asList(str);
    Collections.reverse(list);
    String[] s = (String[])list.toArray(new String[3]);
    for (int i = 0; i < n; i++) {
      sums[i];
    }
  }
}

Compiler output:
Main.java:42: error: not a statement
      sums[i];
          ^
1 error
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<map>

#define mod 1000000007
#define rep(i,N) for(int i=0;i<N;i++)
using namespace std;

int main(){
    int X,Y,Z;
    int K;
    cin>>X>>Y>>Z;
    cin>>K;
    vector<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,A.size())rep(j,B.size())AB.push_back(A[i]+B[j]);
    sort(AB.begin(),AB.end(),greater<long long>());

    vector<long long> ABC;
    rep(i,min({AB.size(),K}))rep(j,C.size())ABC.push_back(AB[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:27:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   27 |     rep(i,min({AB.size(),K}))rep(j,C.size())ABC.push_back(AB[i]+C[j]);
      |           ~~~^~~~~~~~~~~~~~~
a.cc:9:32: note: in definition of macro 'rep'
    9 | #define rep(i,N) for(int i=0;i<N;i++)
      |                                ^
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: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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:   template argument deduction/substitution failed:
a.cc:27:14: note:   deduced conflicting types for parameter '_Tp' ('long unsigned int' and 'int')
   27 |     rep(i,min({AB.size(),K}))rep(j,C.size())ABC.push_back(AB[i]+C[j]);
      |           ~~~^~~~~~~~~~~~~~~
a.cc:9:32: note: in definition of macro 'rep'
    9 | #define rep(i,N) for(int i=0;i<N;i++)
      |                                ^
/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:   candidate expects 2 arguments, 1 provided
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>>X>>K;
  vll A(X), B(Y), C(Z);
  for (int i=0;i<X;++i){
    ll a;cin>>a;A[i]=a;
  }
  for (int i=0;i<Y;++i){
    ll b;cin>>b;B[i]=b;
  }
  for (int i=0;i<Z;++i){
    ll c;cin>>c;C[i]=c;
  }

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

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

  int K_=min(K, X*Y);
  for (int i=0;i<K_;++i){
    for (int j=0;j<Z;++j){
      ll t=partial_sum[i]+C[j];
      ans.push_back(t);
    }
  }

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

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: request for member 'push_back' in 'partial_sum', which is of non-class type 'll' {aka 'long long int'}
   23 |       partial_sum.push_back(s);
      |                   ^~~~~~~~~
a.cc:27:20: error: request for member 'begin' in 'partial_sum', which is of non-class type 'll' {aka 'long long int'}
   27 |   sort(partial_sum.begin(), partial_sum.end(), greater<ll>());
      |                    ^~~~~
a.cc:27:41: error: request for member 'end' in 'partial_sum', which is of non-class type 'll' {aka 'long long int'}
   27 |   sort(partial_sum.begin(), partial_sum.end(), greater<ll>());
      |                                         ^~~
a.cc:33:23: error: invalid types 'll {aka long long int}[int]' for array subscript
   33 |       ll t=partial_sum[i]+C[j];
      |                       ^
a.cc:34:11: error: request for member 'push_back' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   34 |       ans.push_back(t);
      |           ^~~~~~~~~
a.cc:38:12: error: request for member 'begin' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   38 |   sort(ans.begin(), ans.end(), greater<ll>());
      |            ^~~~~
a.cc:38:25: error: request for member 'end' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   38 |   sort(ans.begin(), ans.end(), greater<ll>());
      |                         ^~~
a.cc:41:16: error: invalid types 'll {aka long long int}[int]' for array subscript
   41 |     cout << ans[i] << endl;
      |                ^
Language: C++

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

struct ABC{
    int x,a,b,c;

	ABC(int _x,int _a,int _b,int _c){
		x=_x;a=_a;b=_b;c=_c;	
	}

    bool operator <(const ABC& o ) const{
		return make_tuple(x,a,b,c)<make_tuple(o.x,o.a,o.b,o.c)

    }

}; 



signed main(){
    int X,Y,Z,K;
    cin >>X >>Y >>Z >>K;
    vector<int> A(X),B(Y),C(Z);
    for(auto&& w:A)cin >>w;
    for(auto&& w:B)cin >>w;
    for(auto&& w:C)cin >>w;
    A.push_back((int)-1e17);
    B.push_back((int)-1e17);
    C.push_back((int)-1e17);
   
    sort(A.begin(),A.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());
    sort(C.begin(),C.end(),greater<int>());
    priority_queue<ABC> pq;
    set<int>s; 
    pq.push(ABC(A[0]+B[0]+C[0],0,0,0));
    s.insert(0);

    vector<int>ans;
    
    while(ans.size()<K){
        auto v=pq.top();pq.pop();
        ans.push_back(v.x);
        //cout<<"ans "<<v.x<<" "<<v.a<<" "<<v.b<<" "<<v.c<<endl;
        for(int i=0;i<3;i++){
            int a=v.a;
            int b=v.b;
            int c=v.c;
            if (i==0)a++;
            if(i==1)b++;
            if(i==2)c++;
            int hash=(A[a]<<20)+(B[b]<<10)+C[c];
            //cout<<hash<<" "<<a<<" "<<b<<" "<<c<<endl;
            if(s.find(hash)==s.end()){
                s.insert(hash);
                pq.push(ABC(A[a]+B[b]+C[c],a,b,c));
           //     cout<<A[a]+B[b]+C[c]<<" "<<a<<" "<<b<<" "<<c<<" "<<endl;
            }
        }
    }
    for(auto&& w:ans)cout<<w<<endl;

}



Compiler output:
a.cc: In member function 'bool ABC::operator<(const ABC&) const':
a.cc:15:5: error: expected ';' before '}' token
   15 |     }
      |     ^
Language: C++

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

struct ABC{
    int x,a,b,c;

	ABC(int _x,int _a,int _b,int _c){
		x=_x;a=_a;b=_b;c=_c;	
	}

    bool operator <(const ABC& other ) const{
		if (x==other.x){
		if(a==other.a){
		if(b==other.b){
		return c<other.c;
		}else return b<other.b;		
		}else retrun a<other.a;
        }else return x < other.x;
    }

}; 



signed main(){
    int X,Y,Z,K;
    cin >>X >>Y >>Z >>K;
    vector<int> A(X),B(Y),C(Z);
    for(auto&& w:A)cin >>w;
    for(auto&& w:B)cin >>w;
    for(auto&& w:C)cin >>w;
    A.push_back((int)-1e17);
    B.push_back((int)-1e17);
    C.push_back((int)-1e17);
   
    sort(A.begin(),A.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());
    sort(C.begin(),C.end(),greater<int>());
    priority_queue<ABC> pq;
    set<int>s; 
    pq.push(ABC(A[0]+B[0]+C[0],0,0,0));
    s.insert(0);

    vector<int>ans;
    
    while(ans.size()<K){
        auto v=pq.top();pq.pop();
        ans.push_back(v.x);
        //cout<<"ans "<<v.x<<" "<<v.a<<" "<<v.b<<" "<<v.c<<endl;
        for(int i=0;i<3;i++){
            int a=v.a;
            int b=v.b;
            int c=v.c;
            if (i==0)a++;
            if(i==1)b++;
            if(i==2)c++;
            int hash=(A[a]<<20)+(B[b]<<10)+C[c];
            //cout<<hash<<" "<<a<<" "<<b<<" "<<c<<endl;
            if(s.find(hash)==s.end()){
                s.insert(hash);
                pq.push(ABC(A[a]+B[b]+C[c],a,b,c));
           //     cout<<A[a]+B[b]+C[c]<<" "<<a<<" "<<b<<" "<<c<<" "<<endl;
            }
        }
    }
    for(auto&& w:ans)cout<<w<<endl;

}



Compiler output:
a.cc: In member function 'bool ABC::operator<(const ABC&) const':
a.cc:18:23: error: 'retrun' was not declared in this scope
   18 |                 }else retrun a<other.a;
      |                       ^~~~~~
a.cc:20:5: warning: control reaches end of non-void function [-Wreturn-type]
   20 |     }
      |     ^
Language: C++

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

struct ABC{
    int x,a,b,c;

	ABC(int _x,int _a,int _b,int _c){
		x=_x;a=_a;b=_b;c=_c;	
	}

    bool operator <(const ABC& other ) const{
        return x < other.x;
    }

}; 



signed main(){
    int X,Y,Z,K;
    cin >>X >>Y >>Z >>K;
    vector<int> A(X),B(Y),C(Z);
    for(auto&& w:A)cin >>w;
    for(auto&& w:B)cin >>w;
    for(auto&& w:C)cin >>w;
//    A.push_back((int)-1e17);
//    B.push_back((int)-1e17);
//    C.push_back((int)-1e17);
   
    sort(A.begin(),A.end(),greater<int>());
    sort(B.begin(),B.end(),greater<int>());
    sort(C.begin(),C.end(),greater<int>());
    priority_queue<ABC> pq;
    set<int>s; 
    pq.push(ABC(A[0]+B[0]+C[0],0,0,0));
    s.insert(0);

    vector<int>ans;
    
    for(int j=0;j<K;j++){
        auto v=pq.top();pq.pop();
        ans.push_back(v.x);
        //cout<<"ans "<<v.x<<" "<<v.a<<" "<<v.b<<" "<<v.c<<endl;
        for(int i=0;i<3;i++){
            int a=v.a;
            int b=v.b;
            int c=v.c;
            if (i==0){if(a==X-1)continue;a++;}
            else if(i==1){if(b==Y-1)continue;b++;}
            else if(i==2){if(c==Z-1)continue;c++;}
            int hash=(A[a]<<20)+(B[b]<<10)+C[c];
            //cout<<hash<<" "<<a<<" "<<b<<" "<<c<<endl;
            if(s.find(hash)!=s.end())continue;
                s.insert(hash);
                pq.push(ABC(A[a]+B[b]+C[c],a,b,c));
           //     cout<<A[a]+B[b]+C[c]<<" "<<a<<" "<<b<<" "<<c<<" "<<endl;
            
        }
    }
    for(auto&& w:ans)cout<<w<<endl;

}



Compiler output:
a.cc:3:1: error: 'define' does not name a type
    3 | define int long long
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:34:20: error: 'ABC' was not declared in this scope
   34 |     priority_queue<ABC> pq;
      |                    ^~~
a.cc:34:23: error: template argument 1 is invalid
   34 |     priority_queue<ABC> pq;
      |                       ^
a.cc:34:23: error: template argument 2 is invalid
a.cc:34:23: error: template argument 3 is invalid
a.cc:36:8: error: request for member 'push' in 'pq', which is of non-class type 'int'
   36 |     pq.push(ABC(A[0]+B[0]+C[0],0,0,0));
      |        ^~~~
a.cc:42:19: error: request for member 'top' in 'pq', which is of non-class type 'int'
   42 |         auto v=pq.top();pq.pop();
      |                   ^~~
a.cc:42:28: error: request for member 'pop' in 'pq', which is of non-class type 'int'
   42 |         auto v=pq.top();pq.pop();
      |                            ^~~
a.cc:56:20: error: request for member 'push' in 'pq', which is of non-class type 'int'
   56 |                 pq.push(ABC(A[a]+B[b]+C[c],a,b,c));
      |                    ^~~~