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

#include <iostream>
#include <vector>

using namespace std;


int main(int argc, char** argv) {
    long long n, ans;
    std::vector<long long> w(5);
    cin >> n >> w[0] >> w[1] >> w[2] >> w[3] >> w[4];

    long long smallest{INT_MAX};

    for (int i = 0; i < 5; ++i) {
        if (w[i] < smallest) {
            smallest = w[i];
        }
    }
    ans = 4 + (n / smallest) + ((n % smallest) ? 1:0);

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:12:24: error: 'INT_MAX' was not declared in this scope
   12 |     long long smallest{INT_MAX};
      |                        ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

#include"stdafx.h"
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#define MIN -1000000
using namespace std;
typedef long long ll;
typedef pair <int, int> pll;
bool visited[100005];
const int max_N = 1e5 + 10;

ll N, A, B, C, D, E;


int main(void) {
	cin >> N;
	cin >> A;
	cin >> B;
	cin >> C;
	cin >> D;
	cin >> E;

	ll P[6];
	P[0] = N;
	int t=0;

	while (P[5]!=N) {
		P[5] = P[5] + min(P[4], E);
		P[4] = P[4] - min(P[4], E);

		P[4] = P[4] + min(P[3], D);
		P[3] = P[3] - min(P[3], D);

		P[3] = P[3] + min(P[2], C);
		P[2] = P[2] - min(P[2], C);

		P[2] = P[2] + min(P[1], B);
		P[1] = P[1] - min(P[1], B);

		P[1] = P[1] + min(P[0], A);
		P[0] = P[0] - min(P[0], A);

		t++;
/*
      実行するとこのループが終わらない
*/
    }

	cout << t << endl;

	return 0;
}


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

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
using namespace std;
int main()
{
	long long int n, a[5],num[6];
	cin >> n >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
	long long int min=a[0],kaisu=4;
	for (int i = 1; i < 5; i++) {
		if (min > a[i]) {
			min = a[i];
		}
	}
	kaisu += ceil((long double)n / (long double)min);
	cout << kaisu << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'ceil' was not declared in this scope
   18 |         kaisu += ceil((long double)n / (long double)min);
      |                  ^~~~
Language: C++

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

int main() {
    long int N, A, B, C, D, E;
    cin >> N >> A >> B >> C >> D >> E;

    // 時間のカウント
    long int t = 0;
    
    // 都市(最初は１つ目の都市に全員いる)
    long int city[6]={0}
    city[0] = N

    long int temp;

    // 計算
    while(1) {
      if(city[5] == N) break;

      temp = min(city[0], A);
      city[0] = city[0] - temp
      city[1] = city[1] + temp

      temp = min(city[1], B);
      city[1] = city[1] - temp
      city[2] = city[2] + temp

      temp = min(city[2], C);
      city[2] = city[2] - temp
      city[3] = city[3] + temp

      temp = min(city[3], D);
      city[3] = city[3] - temp
      city[4] = city[4] + temp

      temp = min(city[4], E);
      city[4] = city[4] - temp
      city[5] = city[5] + temp

      // 時間を進める
      t++
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'city'
   14 |     city[0] = N
      |     ^~~~
a.cc:22:7: error: 'temp' was not declared in this scope; did you mean 'tm'?
   22 |       temp = min(city[0], A);
      |       ^~~~
      |       tm
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <bitset>
#include <utility>
#include <sstream>
#include <fstream>
#include <stack>
#include <cstdlib>
#include <complex>
#include <set>

using namespace std;

#define INF 1070000000LL
#define pb push_back
#define irep(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) irep(i,0,n)

typedef long long lint;
typedef pair<int, int> pint;
struct Edge{
    int to,weight;
};
typedef vector<vector<Edge> > Graph;


int main(){
    lint a[5],n;
    int index = 100;
    lint min_a = INF;
    lint ans = 0;
    cin >> n;
    rep(i,5)cin >> a[i];
    rep(i,5){
	if(min_a != min(min_a, a[i])){
	    min_a = min(min_a, a[i]);
	    index = i;
	}
    }
    ans = ceil(n/a[index]) + 5;
    cout << ans << endl;


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

using System;
using System.Collections;
using System.Collections.Generic;

class Program
{
    public static void Main()
    {
        long N = long.Parse(Console.ReadLine());
        long A = long.Parse(Console.ReadLine());
        long B = long.Parse(Console.ReadLine());
        long C = long.Parse(Console.ReadLine());
        long D = long.Parse(Console.ReadLine());
        long E = long.Parse(Console.ReadLine());

        long m = Math.Min(Math.Min(Math.Min(A, B), Math.Min(C, D)), E);

        Console.WriteLine(5 + N/m);
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:7:11: error: expected ':' before 'static'
    7 |     public static void Main()
      |           ^~~~~~~
      |           :
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:9:18: error: expected primary-expression before 'long'
    9 |         long N = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:10:18: error: expected primary-expression before 'long'
   10 |         long A = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:11:18: error: expected primary-expression before 'long'
   11 |         long B = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:12:18: error: expected primary-expression before 'long'
   12 |         long C = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:13:18: error: expected primary-expression before 'long'
   13 |         long D = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:14:18: error: expected primary-expression before 'long'
   14 |         long E = long.Parse(Console.ReadLine());
      |                  ^~~~
a.cc:16:18: error: 'Math' was not declared in this scope
   16 |         long m = Math.Min(Math.Min(Math.Min(A, B), Math.Min(C, D)), E);
      |                  ^~~~
a.cc:18:9: error: 'Console' was not declared in this scope
   18 |         Console.WriteLine(5 + N/m);
      |         ^~~~~~~
Language: C

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

int main(){
long long int N;
cin >> N;
long long int A[5];


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

sort(A,A+5);
long long int ans=0; 
ans += N/A[0];
ans += 5;
if(N%A[0]==0){
    ans--;
}
cout<<ans;
return 0;


}

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

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
ll n,a,b,c,d,e;
  cin>>n>>a>>b>>c>>d>>e;
  ll cnt=0;
  ll le=min(a,min(b,min(c,min(d,e))));
  
 cout<<5+(n-1)/le<<endl;
}
  
  
  
  
  
}

Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

10 10 10 20
7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488
1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338
4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 10 10 10 20
      | ^~
Language: C++

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

void solve() {
  int x, y, z, K; scanf("%d%d%d%d", &x, &y, &z, &K);
  for (int i = 0; i < x; ++i) scanf("%lld", a+i);
  for (int i = 0; i < y; ++i) scanf("%lld", b+i);
  for (int i = 0; i < z; ++i) scanf("%lld", c+i);
  sort(a, a+x, greater<long long>());
  sort(b, b+y, greater<long long>());
  sort(c, c+z, greater<long long>());
  vector<long long> v;
  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) break;
	v.push_back(a[i]+b[j]+c[j]);
      }
    }
  }
  sort(v.begin(), v.end(), greater<long long>());
  for (int i = 0; i < K; ++i) printf("%lld\n", v[i]);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:17:45: error: 'a' was not declared in this scope
   17 |   for (int i = 0; i < x; ++i) scanf("%lld", a+i);
      |                                             ^
a.cc:18:45: error: 'b' was not declared in this scope
   18 |   for (int i = 0; i < y; ++i) scanf("%lld", b+i);
      |                                             ^
a.cc:19:45: error: 'c' was not declared in this scope
   19 |   for (int i = 0; i < z; ++i) scanf("%lld", c+i);
      |                                             ^
a.cc:20:8: error: 'a' was not declared in this scope
   20 |   sort(a, a+x, greater<long long>());
      |        ^
a.cc:21:8: error: 'b' was not declared in this scope
   21 |   sort(b, b+y, greater<long long>());
      |        ^
a.cc:22:8: error: 'c' was not declared in this scope
   22 |   sort(c, c+z, greater<long long>());
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long 
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
 
// debug templates 
#define debug(x)       cerr<< #x <<" : "<< x << endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";
 

void solve(){
	ll x,y,z,kk; cin >> x >> y >> z >> k;
	ll a[x], b[y], c[z];
	FOR(x) cin >> a[i];
	FOR(y) cin >> b[i];
	FOR(z) cin >> c[i];
	// for all possible elms in a and b combine it with highest val numbers in c until > k
	sort(c,c+z,greater<ll>());
	
	multiset<ll> ans;
	int c_idx = 0;
	while(ans.size() < k){
		FOR(i,x){
			FOR(j,y){
				ans.insert(a[i] + b[j] + c[c_idx]);
			}
		}
		++ c_idx;
	}
	auto itr = ans.end();
	int cnt = 0;
	while(cnt < k){
		--itr;
		++cnt;
		cout << *itr << '\n';
	}
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	solve();
	return 0;
}
 


Compiler output:
a.cc: In function 'void solve()':
a.cc:32:44: error: 'k' was not declared in this scope; did you mean 'kk'?
   32 |         ll x,y,z,kk; cin >> x >> y >> z >> k;
      |                                            ^
      |                                            kk
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll x,y,z,k;
  cin>>x>>y>>z>>k;
  vll a(x),b(y),c(z);
  rep(i,x) cin>>a[i];
  rep(i,y) cin>>b[i];
  vll d(0);
  rep(i,x)rep(j,w){
    d.pb(a[i]+b[j]);
  }
  sort(rall(d));
  rep(i,z) cin>>c[i];
  sort(rall(c));
  vll r(0);
  rep(i,min(3000LL,x+y))rep(j,z){
    r.pb(d[i]+c[j]);
  }
  sort(rall(r));
  COUT(r[k]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:17: error: 'w' was not declared in this scope
   53 |   rep(i,x)rep(j,w){
      |                 ^
a.cc:10:38: note: in definition of macro 'rep'
   10 | #define rep(i,n) for (ll i = 0; i < (n); i++)
      |                                      ^
Language: C++

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	if (v.size()) {
		os << v[0];
		for (int i = 1; i < v.size(); i++) os << " " << v[i];
	}
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	int X, Y, Z, K; cin >> X >> Y >> Z >> K;
	vll A(X), B(Y), C(Z); cin >> A >> B >> C;
	sort(begin(A), end(A));
	sort(begin(B), end(B));
	sort(begin(C), end(C));
	ll ok = -1, ng = 1e12;

	while (abs(ok-ng)>1) {
		ll limit = (ok+ng)/2;
		ll cnt = 0;
		for (int i = 0; i < X; i++) {
			for (int j = 0; j < Y; j++) {
				int k = lower_bound(begin(C), end(C), limit - A[i] - B[j]) - begin(C);
				cnt += Z-k;
			}
		}
		if (cnt >= K) ok = limit;
		else ng = limit;
	}

	vll ans;
	for (int i = 0; i < X; i++) {
		for (int j = 0; j < Y; j++) {
			int k = lower_bound(begin(C), end(C), ok - A[i] - B[j]) - begin(C);
			for (; k < Z; k++) {
				ans.push_back(A[i] + B[j] + C[k]);
			}
		}
	}
	sort(rbegin(ans), rend(ans));
	for (int i = 0; i < K; i++) {
		cout << an << el;
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:101:25: error: 'an' was not declared in this scope; did you mean 'ans'?
  101 |                 cout << an << el;
      |                         ^~
      |                         ans
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll x,y,z,k;
    cin>>x>>y>>z>>k;
    ll a[x],b[y],c[z];
    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];
    }
    vector<ll>max2;
    for(ll i=0;i<x;i++)
    {
        for(ll j=0;j<y;j++)
        {
            max2.push_back(a[i]+b[j]);
        }
    }
    sort(max2.begin(),max2.end(),greater<ll>());
    vector<ll>max3;
    for(ll i=0;i<max(k,max2.size());i++)
    {
        for(ll j=0;j<z;j++)
        {
            max3.push_back(max2[i]+c[j]);
        }
    }
    sort(max3.begin(),max3.end(),greater<ll>());
    for(ll i=0;i<k;i++)
    {
        cout<<max3[i]<<" ";
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: no matching function for call to 'max(long long int&, std::vector<long long int>::size_type)'
   32 |     for(ll i=0;i<max(k,max2.size());i++)
      |                  ~~~^~~~~~~~~~~~~~~
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:32:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'})
   32 |     for(ll i=0;i<max(k,max2.size());i++)
      |                  ~~~^~~~~~~~~~~~~~~
/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:32:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |     for(ll i=0;i<max(k,max2.size());i++)
      |                  ~~~^~~~~~~~~~~~~~~
Language: C++

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

bool included[1000][1000][1000] = {false};

typedef struct {
  long long deli;
  int apos;
  int bpos;
  int cpos;
}ANS;

static bool lerger(const long long& a, const long long& b) {
  return a > b;
}
static bool ans_lerger(const ANS& a, const ANS& b) {
  return a.deli > b.deli;
}

int main(void) {
  int 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];

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

  memset(included, 0, sizeof(included));

  int apos = 0, bpos = 0, cpos = 0;

  vector <ANS> ans;
  ANS top;
  top.deli = A[0] + B[0] + C[0];
  top.apos = top.bpos = top.cpos = 0;
  ans.push_back(top);
  included[0][0][0] = true;

  for (int i = 0; i < K; i++) {
    sort(ans.begin()+i, ans.end(), ans_lerger);
    ANS wk = ans[i];
    cout << wk.deli << endl;


    if (wk.apos < X-1) {
      if (!included[wk.apos+1][wk.bpos][wk.cpos]) {
        included[wk.apos+1][wk.bpos][wk.cpos] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.apos = wk.apos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
    if (wk.bpos < Y-1) {
      if (!included[wk.apos][wk.bpos+1][wk.cpos]) {
        included[wk.apos][wk.bpos+1][wk.cpos] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.bpos = wk.bpos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
    if (wk.cpos < Z-1) {
      if (!included[wk.apos][wk.bpos][wk.cpos+1]) {
        included[wk.apos][wk.bpos][wk.cpos+1] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.cpos = wk.cpos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:3: error: 'memset' was not declared in this scope
   34 |   memset(included, 0, sizeof(included));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

bool included[1000][1000][1000] = {false};

typedef struct ANS{
  long long deli;
  int apos;
  int bpos;
  int cpos;
};

static bool lerger(const long long& a, const long long& b) {
  return a > b;
}
static bool ans_lerger(const ANS& a, const ANS& b) {
  return a.deli > b.deli;
}

int main(void) {
  int 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];

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

  memset(included, 0, sizeof(included));

  int apos = 0, bpos = 0, cpos = 0;

  vector <ANS> ans;
  ANS top;
  top.deli = A[0] + B[0] + C[0];
  top.apos = top.bpos = top.cpos = 0;
  ans.push_back(top);
  included[0][0][0] = true;

  for (int i = 0; i < K; i++) {
    sort(ans.begin()+i, ans.end(), ans_lerger);
    ANS wk = ans[i];
    cout << wk.deli << endl;


    if (wk.apos < X-1) {
      if (!included[wk.apos+1][wk.bpos][wk.cpos]) {
        included[wk.apos+1][wk.bpos][wk.cpos] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.apos = wk.apos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
    if (wk.bpos < Y-1) {
      if (!included[wk.apos][wk.bpos+1][wk.cpos]) {
        included[wk.apos][wk.bpos+1][wk.cpos] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.bpos = wk.bpos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
    if (wk.cpos < Z-1) {
      if (!included[wk.apos][wk.bpos][wk.cpos+1]) {
        included[wk.apos][wk.bpos][wk.cpos+1] = true;
        ANS next_ans;
        next_ans = wk;
        next_ans.cpos = wk.cpos+1;
        next_ans.deli = A[next_ans.apos] + B[next_ans.bpos] + C[next_ans.cpos];
        ans.push_back(next_ans);
      }
    }
  }

  return 0;
}


Compiler output:
a.cc:8:1: warning: 'typedef' was ignored in this declaration
    8 | typedef struct ANS{
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:34:3: error: 'memset' was not declared in this scope
   34 |   memset(included, 0, sizeof(included));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: Java

import java.util.*;
public class Main {
	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 [] in1 = new int [x];
        long [] in2 = new int [y];
        long [] in3 = new int [z];
        for(int i=0;i<x;i++){
                             in1[i] = sc.nextLong();
                            }
        for(int i=0;i<y;i++){
                             in2[i] = sc.nextLong();
                            }	
        for(int i=0;i<z;i++){
                             in3[i] = sc.nextLong();
                            }
        Arrays.sort(in1);
        Arrays.sort(in2);
        Arrays.sort(in3);
        int X = x-1;
        int Y = y-1;
        int Z = z-1;
        long dx,dy,dz;
        if(X>0){dx = in1[X]-in1[X-1];}
        else{dx=in1[x-1]+in2[y-1]+in3[z-1];}
        if(Y>0){dy = in2[Y]-in2[Y-1];}
        else{dy=in1[x-1]+in2[y-1]+in3[z-1];}
        if(Z>0){dz = in3[Z]-in3[Z-1];}
        else{dz=in1[x-1]+in2[y-1]+in3[z-1];}
	    for(int i=0;i<k;i++){System.out.println(in1[X]+in2[Y]+in3[Z]);
                            if(dx<=dy && dx<=dz){X--;
                                                 if(X>0){dx = in1[X]-in1[X-1];}
        else{dx=in1[x-1]+in2[y-1]+in3[z-1];}}
                             else{if(dy<=dz){Y--;
                                             if(Y>0){dy = in2[Y]-in2[Y-1];}
        else{dy=in1[x-1]+in2[y-1]+in3[z-1];}}
                                  else{Z--;
                                      if(Z>0){dz = in3[Z]-in3[Z-1];}
        else{dz=in1[x-1]+in2[y-1]+in3[z-1];}}
                                 }
                            }
  }
}


Compiler output:
Main.java:9: error: incompatible types: int[] cannot be converted to long[]
		long [] in1 = new int [x];
		              ^
Main.java:10: error: incompatible types: int[] cannot be converted to long[]
        long [] in2 = new int [y];
                      ^
Main.java:11: error: incompatible types: int[] cannot be converted to long[]
        long [] in3 = new int [z];
                      ^
3 errors
Language: Java

import java.util.*;
public class Main {
	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 [] in1 = new int [x];
        long [] in2 = new int [y];
        long [] in3 = new int [z];
        for(int i=0;i<x;i++){
                             in1[i] = sc.nextInt();
                            }
        for(int i=0;i<y;i++){
                             in2[i] = sc.nextInt();
                            }	
        for(int i=0;i<z;i++){
                             in3[i] = sc.nextInt();
                            }
        Arrays.sort(in1);
        Arrays.sort(in2);
        Arrays.sort(in3);
        int X = x-1;
        int Y = y-1;
        int Z = z-1;
        long dx,dy,dz;
        if(X>0){dx = in1[X]-in1[X-1];}
        else{dx=in1[x-1]+in2[y-1]+in3[z-1];}
        if(Y>0){dy = in2[Y]-in2[Y-1];}
        else{dy=in1[x-1]+in2[y-1]+in3[z-1];}
        if(Z>0){dz = in3[Z]-in3[Z-1];}
        else{dz=in1[x-1]+in2[y-1]+in3[z-1];}
	    for(int i=0;i<k;i++){System.out.println(in1[X]+in2[Y]+in3[Z]);
                            if(dx<=dy && dx<=dz){X--;
                                                 if(X>0){dx = in1[X]-in1[X-1];}
        else{dx=in1[x-1]+in2[y-1]+in3[z-1];}}
                             else{if(dy<=dz){Y--;
                                             if(Y>0){dy = in2[Y]-in2[Y-1];}
        else{dy=in1[x-1]+in2[y-1]+in3[z-1];}}
                                  else{Z--;
                                      if(Z>0){dz = in3[Z]-in3[Z-1];}
        else{dz=in1[x-1]+in2[y-1]+in3[z-1];}}
                                 }
                            }
  }
}

Compiler output:
Main.java:9: error: incompatible types: int[] cannot be converted to long[]
		long [] in1 = new int [x];
		              ^
Main.java:10: error: incompatible types: int[] cannot be converted to long[]
        long [] in2 = new int [y];
                      ^
Main.java:11: error: incompatible types: int[] cannot be converted to long[]
        long [] in3 = new int [z];
                      ^
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int x,y,z,K;
    int i,j,k;
    cin>>x>>y>>z>>K;
    priority_queue<long long>abc;
    long long a[x];
    long long b[y];
    long long c[z];
    for(i=0; i<x; i++){
    cin>>a[i];}
    for(i=0; i<y; i++){
    cin>>b[i];}
    for(i=0; i<z; i++){
    cin>>a[i];}
    for(i=0;i<x;i++ ){
    for(j=0;j<y;j++ ){
    for(k=0;k<z;k++ ){
    abc.push(a[i]+b[j]+c[k]);}}}
    for(k=0;k<K;k++ ){
    cout<<abc.front()<<endl;
    abc.pop();}}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'class std::priority_queue<long long int>' has no member named 'front'
   22 |     cout<<abc.front()<<endl;
      |               ^~~~~
Language: C++

#include <iostream>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <tuple>

constexpr int MAX = 1010;

using ll = long long int;
using T = std::tuple<ll, int, int, int>;

ll a[MAX], b[MAX], c[MAX];

std::set<T> used;
std::priority_queue<T> que;

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

int main()
{

    int x, y, z, k;

    std::cin >> x >> y >> z >> k;

    for (int i = 0; i < x; ++i)
        std::cin >> a[i];
    for (int i = 0; i < y; ++i)
        std::cin >> b[i];
    for (int i = 0; i < z; ++i)
        std::cin >> c[i];

    std::sort(a, a + x, std::greater<>());
    std::sort(b, b + y, std::greater<>());
    std::sort(c, c + z, std::greater<>());

    que.emplace(a[0] + b[0] + c[0], 0, 0, 0);

    for (int i = 0; i < k; ++i)
    {
        int t, X, Y, Z;
        std::tie(t, X, Y, Z) = que.top();
        que.pop();
        std::cout << t << std::endl;

        for (int j = 0; j < 3; ++j)
        {
            int xx = X + dx[j], yy = Y + dy[j], zz = Z + dz[j];
            if (xx == x || yy == y || zz == z)
                continue;
            int tt = a[xx] + b[yy] + c[zz];
            if (used.count(T(tt, xx, yy, zz)))
                continue;
            que.emplace(tt, xx, yy, zz);
            used.emplace(tt, xx, yy, zz);
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   34 |     std::sort(a, a + x, std::greater<>());
      |          ^~~~
      |          qsort
a.cc:35:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   35 |     std::sort(b, b + y, std::greater<>());
      |          ^~~~
      |          qsort
a.cc:36:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   36 |     std::sort(c, c + z, std::greater<>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <queue>
#include <tuple>
#include <set>
#include <vector>
using namespace std;

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

	vector<int64_t> A(X+1);
	vector<int64_t> B(Y+1);
	vector<int64_t> C(Z+1);

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

	for (int i = 0; i < Y; ++i)
	{
		cin >> B[i];
	}
	B[Y] = -100000000000;

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

	sort(A.begin(), A.end(), std::greater<int64_t>());
	sort(B.begin(), B.end(), std::greater<int64_t>());
	sort(C.begin(), C.end(), std::greater<int64_t>());

	using elem = tuple<int64_t, int, int, int>;

	auto compare = [](elem a, elem b) {
		return get<0>(a) < get<0>(b);
	};

	priority_queue<elem, vector<elem>, decltype(compare)> que(compare);
	set<elem> checker;
	elem first_elem = make_tuple(A[0] + B[0] + C[0], 0, 0, 0);

	que.push(first_elem);
	checker.insert(first_elem);
	for (int i = 0; i < K; ++i)
	{
		elem top_elem = que.top();
		
		int64_t sum = get<0>(top_elem);
		int l = get<1>(top_elem);
		int m = get<2>(top_elem);
		int n = get<3>(top_elem);

		cout << sum << endl;
		elem candidate[3] =
		{ make_tuple(A[l+1] + B[m] + C[n], l+1, m, n)
		, make_tuple(A[l] + B[m+1] + C[n], l, m+1, n)
		, make_tuple(A[l] + B[m] + C[n+1], l, m, n+1) };

		que.pop();

		for (int j = 0; j < 3; ++j)
		{
			if (checker.find(candidate[j]) == checker.end())
			{
				checker.insert(candidate[j]);
				que.push(candidate[j]);
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   35 |         sort(A.begin(), A.end(), std::greater<int64_t>());
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <iterator>
#include <iomanip>
using namespace std;


int main(){
    long long x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<usigned 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<unsigned long long> ans;
    for(int i = z - 1; i >= 0; --i)
       for(int j = y - 1; j >= 0; --j)
           for(int l = x - 1; l >= 0; --l){
               ans.push_back(c[i] + b[j] + a[l]);
           }
    
    sort(ans.rbegin(), ans.rend());
    for(int i = 0; i < k; ++i) cout << ans[i]<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'usigned' was not declared in this scope; did you mean 'unsigned'?
   22 |     vector<usigned long long> a(x), b(y), c(z);
      |            ^~~~~~~
      |            unsigned
a.cc:22:29: error: template argument 1 is invalid
   22 |     vector<usigned long long> a(x), b(y), c(z);
      |                             ^
a.cc:22:29: error: template argument 2 is invalid
a.cc:23:41: error: invalid types 'int[int]' for array subscript
   23 |     for(int i = 0; i < x; ++i)  cin >> a[i];
      |                                         ^
a.cc:24:41: error: invalid types 'int[int]' for array subscript
   24 |     for(int i = 0; i < y; ++i)  cin >> b[i];
      |                                         ^
a.cc:25:41: error: invalid types 'int[int]' for array subscript
   25 |     for(int i = 0; i < z; ++i)  cin >> c[i];
      |                                         ^
a.cc:31:31: error: invalid types 'int[int]' for array subscript
   31 |                ans.push_back(c[i] + b[j] + a[l]);
      |                               ^
a.cc:31:38: error: invalid types 'int[int]' for array subscript
   31 |                ans.push_back(c[i] + b[j] + a[l]);
      |                                      ^
a.cc:31:45: error: invalid types 'int[int]' for array subscript
   31 |                ans.push_back(c[i] + b[j] + a[l]);
      |                                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll x, y, z, k, s;
  in3(x, y, z);
  in(k);
  vector<ll> a(x), b(y), c(z), d, e;
  rep(i, x)
    in(a[i]);
  rep(i, y)
    in(b[i]);
  rep(i, z)
    in(c[i]);
  rep(i, x){
    rep(j, y)
      d.pb(a[i] + b[j]);
  }
  sort(all(d));
  reverse(all(d));
  s = max(d.size() - k, 0ll);
  rep(i, s)
    d.pop_back();
  rep(i, d.size()){
    rep(j, z)
      e.pb(d[i] + c[j]);
  }
  sort(all(e));
  reverse(all(e));
  rep(i, k){
    out(e[i]);
    memi;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: no matching function for call to 'max(long long unsigned int, long long int)'
   34 |   s = max(d.size() - k, 0ll);
      |       ~~~^~~~~~~~~~~~~~~~~~~
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:34:10: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'long long int')
   34 |   s = max(d.size() - k, 0ll);
      |       ~~~^~~~~~~~~~~~~~~~~~~
/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:34:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   34 |   s = max(d.size() - k, 0ll);
      |       ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>

using namespace std;
typedef long long ll;

ll Record[3000];
int RecordCount = 0;

int Binary_Search(ll a, ll b[], int N, ll Value, bool isRecord){
	if(a + b[N-1] <= Value){
		return 0;
	}
	
	int min = 0;
	int max = N-1;
	while(max - min > 0){
		//printf("%lld %lld\n", min, max);
		int mid = min + (max - min)/2;
		if(a + b[mid] > Value){
			max = mid;
		}else{
			min = mid + 1;
		}
	}
	
	if(isRecord){
		for(int i = min; i < N; i++){
			Record[RecordCount] = a + b[i];
			RecordCount++;
		}
	}
	
	return N - min;
}

int main()
{
	int X, Y, Z, K;
	ll A[1000];
	ll B[1000];
	ll C[1000];
	
	scanf("%d %d %d %d", &X, &Y, &Z, &K);
	for(int i = 0; i < X; i++){
		scanf("%lld", &A[i]);
	}
	for(int i = 0; i < Y; i++){
		scanf("%lld", &B[i]);
	}
	for(int i = 0; i < Z; i++){
		scanf("%lld", &C[i]);
	}
	
	ll BC[1000000];
	
	for(int i = 0; i < Y; i++){
		for(int j = 0; j < Z; j++){
			BC[i*Z+j] = B[i] + C[j];
		}
	}
	
	sort(A, A+X);
	sort(BC, BC+Y*Z);
	
	{
		ll min = 0;
		ll max = 300000000000;
		
		while(max - min > 0){
			// printf("%lld %lld\n", min, max);
			ll mid = min + (max - min)/2;
			int count = 0;
			for(int j = 0; j < X; j++){
				count += Binary_Search(A[j], Y*Z > K ? BC + (Y*Z-K) : BC, Y*Z > K ? K : Y*Z, mid, false);
			}
			
			if(count < K){
				max = mid;
			}else{
				min = mid + 1;
			}
		}
		
		for(int j = 0; j < X; j++){
			Binary_Search(A[j], Y*Z > K ? BC + (Y*Z-K) : BC, Y*Z > K ? K : Y*Z, min, true);
		}
		sort(Record, Record + RecordCount);
		
		for(int i = RecordCount - 1; i >= 0; i--){
			printf("%lld\n", Record[i]);
		}
		printf("%lld\n", min);
		
		nextMax = min;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:100:17: error: 'nextMax' was not declared in this scope
  100 |                 nextMax = min;
      |                 ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
	int x, y, z, k;
	cin >> x >> y >> z >> k;
	vector<ll> 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<ll> ab;
	rep(i, x)rep(j, y) ab.push_back(a[i]+b[j]);
	sort(ab.begin(), ab.end(), greater<ll>());
	//rep(i, ab.size()) cout << ab[i] << endl;
	vector<ll> abc;
	rep(i, k)rep(j, z) abc.push_back(ab[i]+c[j]);
	sort(abc.begin(), abc.end(), greater<ll>());
	//rep(i, abc.size()) cout << abc[i] << endl;
	rep(i, k) cout << abc[i] << endl;
	return 0;
}
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
	int x, y, z, k;
	cin >> x >> y >> z >> k;
	vector<ll> 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<ll> ab;
	rep(i, x)rep(j, y) ab.push_back(a[i]+b[j]);
	sort(ab.begin(), ab.end(), greater<ll>());
	//rep(i, ab.size()) cout << ab[i] << endl;
	vector<ll> abc;
	rep(i, k)rep(j, z) abc.push_back(ab[i]+c[j]);
	sort(abc.begin(), abc.end(), greater<ll>());
	//rep(i, abc.size()) cout << abc[i] << endl;
	rep(i, k) cout << abc[i] << endl;
	return 0;
}


Compiler output:
a.cc:31:5: error: redefinition of 'int main()'
   31 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
Language: Java

import java.util.*;
import java.util.Map.Entry;
 
class Main {
//	 static int mod =  (int) (Math.pow(10,9)+7);
//	 static int mod = 998244353;
   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();
//       int B = sc.nextInt();
//       String S = sc.next();
//       String T = sc.next();
//       char[] s = S.toCharArray();
//       char[] t = T.toCharArray();
       
       long[] a = new long[(int)X];
       for (int i=0 ; i<X; i++) {
           a[i] = sc.nextLong();
       } 
       long[] ab=new long[X*Y];
       long b = 0;
       for (int i=0 ; i<Y; i++) {
           b = sc.nextLong();
           for(int j=0;j<X;j++) {
        	   ab[i*Y+j]=a[j]+b;
           }
       }
       Arrays.sort(ab);
       long[] c = new long[(int)Z];
       for (int i=0 ; i<Z; i++) {
           c[i] = sc.nextLong();
       } 
       Arrays.sort(c);
	   long right=30000000001l;
	   long left=-1;
	   while(right-left>1) {
		   long mid=left+(right-left)/2;
		   long cnt=0;
		   for(int i=0;i<X*Y;i++) {
			   int lw=-1;
			   int up=Z;
			   while(up-lw>1) {
				   int ave=lw+(up-lw)/2;
				   if(ab[i]+c[ave]>=mid)up=ave;
				   else lw=ave;

Compiler output:
Main.java:49: error: reached end of file while parsing
				   else lw=ave;
				               ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,vector<ll>> Data;
#define rep(i,n) for(ll i=0;i<(n);i++)
int main(){
  vector<ll> n(3);
  rep(i,3) cin>>n[i];
  ll k;cin>>k;
  vector<vector<ll>> v(3);
  rep(i,3){
    rep(j,n[i]){
      ll tmp;cin>>tmp;
      v[i].push_back(tmp);
    }
    sort(ALL(v),greater<ll>());
  }
  priority_queue<Data> que;
  que.push(v[0][0]+v[1][0]+v[2][0],vector<ll>({0,0,0}));
  rep(i,k){
    auto c=que.top();que.pop();
    cout<<c.first<<endl;
    rep(iter,3){
      if(c.second[iter]+1<n[iter]){
        ll sum=c.first-v[iter][c.second[iter]]+v[iter][c.second[iter]+1];
        auto num=c.second;num[iter]++;
        if(!st.count(Data(sum,num))) st.insert(d),que.push(d);
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'ALL' was not declared in this scope
   16 |     sort(ALL(v),greater<ll>());
      |          ^~~
a.cc:19:11: error: no matching function for call to 'std::priority_queue<std::pair<long long int, std::vector<long long int> > >::push(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, std::vector<long long int>)'
   19 |   que.push(v[0][0]+v[1][0]+v[2][0],vector<ll>({0,0,0}));
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<long long int, std::vector<long long int> >; _Sequence = std::vector<std::pair<long long int, std::vector<long long int> >, std::allocator<std::pair<long long int, std::vector<long long int> > > >; _Compare = std::less<std::pair<long long int, std::vector<long long int> > >; value_type = std::pair<long long int, std::vector<long long int> >]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<long long int, std::vector<long long int> >; _Sequence = std::vector<std::pair<long long int, std::vector<long long int> >, std::allocator<std::pair<long long int, std::vector<long long int> > > >; _Compare = std::less<std::pair<long long int, std::vector<long long int> > >; value_type = std::pair<long long int, std::vector<long long int> >]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 2 provided
a.cc:27:13: error: 'st' was not declared in this scope; did you mean 'std'?
   27 |         if(!st.count(Data(sum,num))) st.insert(d),que.push(d);
      |             ^~
      |             std
a.cc:27:48: error: 'd' was not declared in this scope
   27 |         if(!st.count(Data(sum,num))) st.insert(d),que.push(d);
      |                                                ^
Language: C++

X,Y,Z,K = map(int, input().split())
a_list = [int(i) for i in input().split()]
b_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]

# list top K of a+b
a_plus_b_list = []
for a in a_list:
    for b in b_list:
        a_plus_b_list.append(a+b)
a_plus_b_list.sort(reverse = True)

# list top K of a+b+c
d_list = []
for a_b in a_plus_b_list:
    for c in c_list:
        d_list.append(a_b + c)
d_list.sort(reverse = True)
for i in range(K):
    print(d_list[i])

Compiler output:
a.cc:6:3: error: invalid preprocessing directive #list
    6 | # list top K of a+b
      |   ^~~~
a.cc:13:3: error: invalid preprocessing directive #list
   13 | # list top K of a+b+c
      |   ^~~~
a.cc:1:1: error: 'X' does not name a type
    1 | X,Y,Z,K = map(int, input().split())
      | ^