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

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


ll unti(ll t_sub,vector<ll>& ab_max,vector<ll>& c,int x,int y,int z,int k){
  int ret=0;
  for(int i=0;i<x*y;i++){
    ll h=z-(lower_bound(c.begin(),c.end(),t_sub-ab_max[i])-c.begin());
    if(h==0 or ret>=k) return ret;
    else ret+=h;
  }
  return ret;
}

signed main(){
  int x,y,z,k;
  cin >> x >> y >> z >> k;
  vector<ll> a(x);vector<ll> b(y);vector<ll> 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];
  sort(c.begin(),c.end());
  vector<ll> ab_max(x*y);
  int v=0;
  for(int i=0;i<x;i++){
    for(int j=0;j<y;j++){
      ab_max[v++]=(a[i]+b[j]);
    }
  }
  sort(ab_max.begin(),ab_max.end());
  ll l=0;ll r=ab_max[0]+c[z-1];
  while(r>l+1){
    ll t=floor((l+r)/2);
    if(unti(t,ab_max,c)>=k) r=t;
    else l=t;
  }
  vector<ll> ans;
  bool f=false;
  for(int i=0;i<x*y;i++){
    for(int j=z-1;j>-1;j--){
      ll u=ab_max[i]+c[j];
      if(u>=r){
        ans.push_back(u);
      }else{
        if(j==0) f=true;
        break;
      }
    }
    if(f) break;
  }
  sort(ans.begin(),ans.end(),greater<ll>());
  for(int i=0;i<k;i++){
    cout << ans[i] << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: too few arguments to function 'll unti(ll, std::vector<long long int>&, std::vector<long long int>&, int, int, int, int)'
   38 |     if(unti(t,ab_max,c)>=k) r=t;
      |        ~~~~^~~~~~~~~~~~
a.cc:9:4: note: declared here
    9 | ll unti(ll t_sub,vector<ll>& ab_max,vector<ll>& c,int x,int y,int z,int k){
      |    ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
ll x,y,z,k;

ll unti(ll t_sub,vector<ll>& ab_max,vector<ll>& c){
  ll ret=0;
  for(ll i=0;i<x*y;i++){
    ll h_sub= lower_bound(c.begin(),c.end(),t_sub-ab_max[i])-c.begin();
    ll h=z-h_sub;
    if(h==0 or ret>=k) return ret;
    else ret+=h;
  }
  return ret;
}

signed main(){
  cin >> x >> y >> z >> k;
  vector<ll> a(x);vector<ll> b(y);vector<ll> 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];
  sort(c.begin(),c.end());
  vector<ll> ab_max(x*y);
  for(ll i=0;i<x;i++){
    for(ll j=0;j<y;j++){
      ab_max[i*y+j]=(a[i]+b[j]);
    }
  }
  ll l=0;ll r=ab_max[0]+c[z-1];
  while(r>l+1){
    ll t=floor((l+r)/2);
    if(unti(t,ab_max,c)>=k) r=t;
    else l=t;
  }
  vector<ll> ans;
  bool f=false;
  for(ll i=0;i<x*y;i++){
    for(ll j=z-1;j>-1;j--){
      if(ab_max[i]+c[j]>=r){
        ans.push_back(u);
      }else{
        if(j==0) f=true;
        break;
      }
    }
    if(f) break;
  }
  sort(ans.begin(),ans.end(),greater<ll>());
  for(ll i=0;i<k;i++){
    cout << ans[i] << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: 'u' was not declared in this scope
   44 |         ans.push_back(u);
      |                       ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define int long long

signed main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<int> a(X),b(Y),c(Z),v;
  
  for(auto &i:a)cin >> i;
  
  sort(a.begin(), a.end(), greater<int>());
  
  for(auto &i:b)cin >> i;
  
  sort(b.begin(), b.end(), greater<int>());
  
  for(auto &i:c)cin >> i;
  
  sort(c.begin(), c.end(), greater<int>());
  
  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) v.push_back(a[i]+b[j]+c[k]);
        else break;
      }
    }
  }
  sort(v.begin(), v.end(), greater<int>());
  for(int i = 0;i<k;i++)cout << v[i] << endl;
  
  return 0;
}
  


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

#include<bits/stdc++.h>

using namespace std;

#define int long long

signed main(){
  int X,Y,Z,K;
  cin >> X >> Y >> Z >> K;
  
  vector<int> a(X),b(Y),c(Z);
  
  for(auto &i:a)cin >> i;
  
  sort(a.begin(), a.end(), greater<int>());
  
  for(auto &i:b)cin >> i;
  
  sort(b.begin(), b.end(), greater<int>());
  
  for(auto &i:c)cin >> i;
  
  sort(c.begin(), c.end(), greater<int>());
  
  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) v.push_back(a[i]+b[j]+c[k]);
        else break;
      }
    }
  }
  sort(v.begin(), v.end(), greater<int>());
  for(int i = 0;i<k;i++)cout << v[i] << endl;
  
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:36: error: 'v' was not declared in this scope
   28 |         if((i+1)*(j+1)*(k+1) <= K) v.push_back(a[i]+b[j]+c[k]);
      |                                    ^
a.cc:33:8: error: 'v' was not declared in this scope
   33 |   sort(v.begin(), v.end(), greater<int>());
      |        ^
a.cc:34:19: error: 'k' was not declared in this scope
   34 |   for(int i = 0;i<k;i++)cout << v[i] << endl;
      |                   ^
Language: C++

def num():
    return int(input())
def nums():
    return list(map(int,input().split()))

X,Y,Z,K = nums()
A = nums()
B = nums()
C = nums()

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

AB = [bi + ai for bi in B for ai in A]
res = []
for ab_sum in AB[:K]:
    for ci in C[:K]:
        res.append(ab_sum + ci)
res.sort(reverse=True)
for ans in res[:K]:
    print(ans)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def num():
      | ^~~
Language: C++

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

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

  vector<long long> v;
  for ( int i = 0; i < x; i++){
    for ( int j = 0; j < y; j++){
      for ( int k = 0; k < z; k++){
        v.push_back(a[i]+b[j]+c[k]);
      }
    }
  }

  sort(v.begin(), v.end());

  for ( int i = v.size()-1; i >= max(v.size()-k, 0); i--){

    cout << v[i] << endl;
  }


  return 0;
}

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

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;
#define ll long long int
ll x, y, z, num, a1[1001], a2[1001], a3[1001], maxi[3001];
map <ll, ll> m;
ll valid (ll tar){
    ll cnt=0, dup=0;
    m.clear();
    for (ll i=0; i<x; i++){
        for (ll j=0; j<y; j++){
            for (ll k=0; k<z; k++){
                if (a1[i]+a2[j]+a3[k]<tar) break;
                if (m[a1[i]+a2[j]+a3[k]]==0) cnt++;
                m[a1[i]+a2[j]+a3[k]]++;
                if (a1[i]+a2[j]+a3[k]==m.rend()->first) dup=m[a1[i]+a2[j]+a3[k]]-1;
                if (cnt>num) return 1;
            }
        }
    }
    if (cnt+dup>=num) return 0;
    return -1;
}
int main(){
    vector <ll> v;
    cin>>x>>y>>z>>num;
    for (ll i=0; i<x; i++) cin>>a1[i], maxi[i]=a1[i];
    for (ll i=0; i<y; i++) cin>>a2[i], maxi[i+x]=a2[i];
    for (ll i=0; i<z; i++) cin>>a3[i], maxi[i+x+y]=a3[i];
    sort (a1, a1+x, greater<ll>());
    sort (a2, a2+y, greater<ll>());
    sort (a3, a3+z, greater<ll>());
    sort (maxi, maxi+x+y+z, greater<ll>());
    ll val, ret, mid, s=maxi[x+y+z-1]+maxi[x+y+z-2]+maxi[x+y+z-3], e=maxi[0]+maxi[1]+maxi[2];
    while (s<=e){
        mid=(s+e)/2;
        ret=valid(mid);
        if (ret==-1) e=mid-1;
        else if (ret==1) s=mid+1;
        else {
            val=mid;
            break;
        }
    }
    for (ll i=0; i<x; i++){
        for (ll j=0; j<y; j++){
            for (ll k=0; k<z; k++){
                if (a1[i]+a2[j]+a3[k]<val || v.size()==num) break;
                v.push_back(a1[i]+a2[j]+a3[k]);
            }
        }
    }
    sort (v.begin(), v.end(), greater<ll>());
    for (ll i=0; i<k; i++) cout<<v[i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:20: error: 'k' was not declared in this scope
   57 |     for (ll i=0; i<k; i++) cout<<v[i]<<endl;
      |                    ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long int
ll x, y, z, num, a1[1001], a2[1001], a3[1001], maxi[3001];
ll valid (ll tar){
    ll cnt=0;
    for (ll i=0; i<x; i++){
        for (ll j=0; j<y; j++){
            for (ll k=0; k<z; k++){
                if (a1[i]+a2[j]+a3[k]<tar) break;
                cnt++;
                if (cnt>num) return 1;
            }
        }
    }
    if (cnt==num) return 0;
    return -1;
}
bool cmp (ll a, ll b){
    return a>b;
}
int main(){
    vector <ll> v;
    cin>>x>>y>>z>>num;
    for (ll i=0; i<x; i++) cin>>a1[i], maxi[i]=a1[i];
    for (ll i=0; i<y; i++) cin>>a2[i], maxi[i+x]=a2[i];
    for (ll i=0; i<z; i++) cin>>a3[i], maxi[i+x+y]=a3[i];
    sort (a1, a1+x, cmp);
    sort (a2, a2+y, cmp);
    sort (a3, a3+z, cmp);
    sort (maxi, maxi+x+y+z, cmp);
    ll val=-1, ret, mid, s=maxi[x+y+z-1]+maxi[x+y+z-2]+maxi[x+y+z-3], e=maxi[0]+maxi[1]+maxi[2];
    while (s<=e){
        mid=(s+e)/2;
        ret=valid(mid);
        if (ret==-1) e=mid-1;
        else if (ret==1) s=mid+1;
        else {
            val=mid;
            break;
        }
    }
    if (val==-1) {for(;;)}
    for (ll i=0; i<x; i++){
        for (ll j=0; j<y; j++){
            for (ll k=0; k<z; k++){
                if (a1[i]+a2[j]+a3[k]<val || v.size()==num) break;
                v.push_back(a1[i]+a2[j]+a3[k]);
            }
        }
    }
    sort (v.begin(), v.end(), greater<ll>());
    for (ll i=0; i<v.size(); i++) cout<<v[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:26: error: expected primary-expression before '}' token
   45 |     if (val==-1) {for(;;)}
      |                          ^
Language: C++

#include <iostream>
#include <vector>
#include <algrithm>
using namespace std;
long long int x, y, z, a1[1001], a2[1001], a3[1001];
vector <long long int> v;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long int tar;
    cin>>x>>y>>z>>tar;
    for (long long int i=0; i<x; i++) cin>>a1[i];
    for (long long int i=0; i<y; i++) cin>>a2[i];
    for (long long int i=0; i<z; i++) cin>>a3[i];
    for (long long int i=0; i<x; i++){
        for (long long int j=0; j<y; j++){
            for (long long int k=0; k<z; k++){
                v.push_back(a1[i]+a2[j]+a3[k]);
            }
        }
    }
    long long int cnt=0;
    sort (v.begin(), v.end());
    for (long long int i=v.size()-1; cnt<tar; i--){
        cnt++;
        cout<<v[i]<<endl;
    }
}

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

#include <iostream>
#include <vector>
using namespace std;
long long int x, y, z, a1[1001], a2[1001], a3[1001];
vector <long long int> v;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long int tar;
    cin>>x>>y>>z>>tar;
    for (long long int i=0; i<x; i++) cin>>a1[i];
    for (long long int i=0; i<y; i++) cin>>a2[i];
    for (long long int i=0; i<z; i++) cin>>a3[i];
    for (long long int i=0; i<x; i++){
        for (long long int j=0; j<y; j++){
            for (long long int k=0; k<z; k++){
                v.push_back(a1[i]+a2[j]+a3[k]);
            }
        }
    }
    long long int cnt=0;
    sort (v.begin(), v.end());
    for (long long int i=v.size()-1; cnt<tar; i--){
        cnt++;
        cout<<v[i]<<endl;
    }
}

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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>

//const int64_t cc = pow( 10, 9 ) + 7;

bool sort_pair( std::pair< char, int64_t > origin, std::pair< char, int64_t > another )
{
    return origin.second > another.second;
}


int64_t main()
{
   int64_t a,b,c,d;
   std::cin>> a;
   std::cin>> b;
   std::cin>> c;
   std::cin>> d;

   std::vector< int64_t > first( a );
   std::vector< int64_t > second( b );
   std::vector< int64_t > third( c );

   for( int64_t i = 0; i < first.size(); i++ )
   {
       std::cin>> first[i];
   }

   for( int64_t i = 0; i < second.size(); i++ )
   {
       std::cin>> second[i];
   }

   for( int64_t i = 0; i < third.size(); i++ )
   {
       std::cin>> third[i];
   }

   std::priority_queue< int64_t > check;

   for( int64_t i = 0; i < first.size(); i++ )
   {
       for( int64_t r = 0; r < second.size(); r++ )
       {
           check.push( first[i] + second[r] );
       }
   }

   std::priority_queue< int64_t > check_list;

   for( int64_t i = 0; i < d; i++ )
   {
       check_list.push( check.top() );
       check.pop();
   }

   std::priority_queue< int64_t > result;
   
   while( !check_list.empty() )
   {
       for( int64_t r = 0; r < third.size(); r++ )
       {
           result.push( check_list.top() + third[r] );
       }

       check_list.pop();
   }

   for( int64_t i = 0; i < d; i++ )
   {
       std::cout<< result.top() <<"\n";
       result.pop();
   }
}


Compiler output:
a.cc:19:1: error: '::main' must return 'int'
   19 | int64_t main()
      | ^~~~~~~
Language: Java

fun main(args :Array<String>) {
    val (x, y, z, k) = readIntegerList()
    val aList = readLongList()
    val bList = readLongList()
    val cList = readLongList()

    val abList = ArrayList<Long>(x * y)
    for (a in aList) {
        abList.addAll(bList.map { it + a })
    }
    val abc = abList.sortedDescending().subList(0, Math.min(k, abList.size))

    val acList = ArrayList<Long>(abc.size * z)
    for (ab in abc) {
        acList.addAll(cList.map { it + ab })
    }
    for (ans in acList.sortedDescending().subList(0, Math.min(k, acList.size))) {
        println(ans)
    }
}

fun readInteger() = readLine()!!.toInt()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
fun main(args :Array<String>) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
fun main(args :Array<String>) {
             ^
Main.java:1: error: class, interface, enum, or record expected
fun main(args :Array<String>) {
                    ^
3 errors
Language: C++

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

int main(){
	long x,y,z,i,h=0,j=0,sum,K;//‘ã“ü
	cin >> x >> y >> z >> K;
	vector<long> A(x);for(i=0;i<x;i++){
		cin >> A[i];
		
	}
	vector<long> B(y);for(i=0;i<y;i++){
		cin >> B[i];
	}
	vector<long> C(z);for(i=0;i<z;i++){
		cin >> C[i];
	}
	sort(A.begin(),A.end(),greater<long>());//ƒ\[ƒg
	sort(B.begin(),B.end(),greater<long>());
	sort(C.begin(),C.end(),greater<long>());
	i=0;
	vector<long> D(x*y);
	for(i=0;i<x;i++){//A‚ÆB‚ð‘«‚·
		for(h=0;h<y;h++){
			D[y*i+h]=A[i]+B[h];
			//cout << D[y*i+h] << endl;
		}
	}
	sort(D.begin(),D.end(),greater<long>());
	vector<long> E(3000*z);
	yeah=min(3000,x*y);
	for(i=0;i<yeah;i++){
		for(h=0;h<z;h++){
			E[z*i+h]=D[i]+C[h];
			//cout << E[z*i+h] << endl;
		}
	}
	sort(E.begin(),E.end(),greater<long>());
	for(i=0;i<K;i++){
		cout << E[i] << endl;
	}
	return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'yeah' was not declared in this scope
   30 |         yeah=min(3000,x*y);
      |         ^~~~
a.cc:30:17: error: no matching function for call to 'min(int, long int)'
   30 |         yeah=min(3000,x*y);
      |              ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:30:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   30 |         yeah=min(3000,x*y);
      |              ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:30:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |         yeah=min(3000,x*y);
      |              ~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long x,y,z,K;cin>>x>>y>>z>>K;
  vector<long>X(x);for(int i=0;i<x;i++)cin>>X[i];
  vector<long>Y(y);for(int i=0;i<y;i++)cin>>Y[i];
  vector<long>Z(z);for(int i=0;i<z;i++)cin>>Z[i];
  sorted(X.begin(),X.end());
  sorted(Y.begin(),Y.end());
  sorted(Z.begin(),Z.end());
  
  vector<long> XY(K*K);
  for(int i=0;i<K;i++){
    for(int j=0;j<K;j++){
      XY[i*K+j]=X[i]+Y[j];
    }
  }
  sort(XY.begin(),XY.end());
  
  vector<long>XYZ(K*K);
  for(int i=0;i<K;i++){
    for(int j=0;j<K;j++){
      XYZ[i*K+j]=XY[i]+Z[j];
    }
  }
  sort(XYZ.begin(),XYZ.end());
  for(int i=0;i<K;i++)cout<<XYZ[i]<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'sorted' was not declared in this scope; did you mean 'strtod'?
    8 |   sorted(X.begin(),X.end());
      |   ^~~~~~
      |   strtod
Language: C++

#include <cmath>
#include<vector>
#define rep(i, n) for (int i=0;i<(n);i++)
#include <map> 
#include<algorithm>
#include <numeric>
#include<iostream>
#include<deque>
#include<queue>
#include<string>
#include <iomanip>
using namespace std;
typedef long long ll;

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

    vector <ll> a(x);
    vector <ll> b(y);
    vector <ll> c(z);

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

    sort(a.begin(), a.end(), greater<int>());
    sort(b.begin(), b.end(), greater<int>());
    sort(c.begin(), c.end(), greater<int>());

    priority_queue <ll> q;

    rep(i, x){
        int tmp_y=min(y, K/i);
        rep(j,tmp_y){
            int tmp_z=min(z, K/i/j);
            rep(l, tmp_z){
                q.push(a[i]*b[j]*c[l]);
            }
        }
    }

    rep(i, K){s
        cout<<q.top()<<endl;
        q.pop();
    }

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:15: error: 's' was not declared in this scope
   49 |     rep(i, K){s
      |               ^
Language: C++

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

ll place[6];

int main(void){
    int x,y,z,k;
    cin >> x >> y >> z >> k;
    vector<ll> a;
    vector<ll> b;
    vector<ll> c;
    priority_queue<ll> ans;
    rep(i,x){
        int num;
        cin >> num;
        a.push_back(num);
    }
    rep(i,y){
        int num;
        cin >> num;
        b.push_back(num);
    }
    rep(i,z){
        int num;
        cin >> num;
        c.push_back(num);
    }
    int mn= (int)(a.size()*b.size()*c.size());
    
    sort(a.begin(),a.end(),greater<int>());
    sort(b.begin(),b.end(),greater<int>());
    sort(c.begin(),c.end(),greater<int>());
    
  	int k = 0;
    for(ll p:a){
        for(ll q:b){
            for(ll r:c){
                ans.push(p+q+r);
              	k++;
              	if(k>=10000){
                  break;
                }
            }
        }
    }
    
    
    mn = min(3000,mn);
    for(int i=0;i<k;i++){
        cout << ans.top() <<endl;
        ans.pop();
    }
    
    return 0;
}







































Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: redeclaration of 'int k'
   36 |         int k = 0;
      |             ^
a.cc:9:15: note: 'int k' previously declared here
    9 |     int x,y,z,k;
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long
#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int A[1100];
int B[1100];
int C[1100];
int D[1000100];
int E[1000000100];

priority_queue<int> PQ;

signed main() {
  int x, y, z, k; 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];
  }

  int t = 0;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      D[t++] = A[i] + B[j];
    }
  }

  sort(D, D+t);
  reverse(D, D+t);

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

  sort(E, E+m);
  reverse(E, E+m);
  for (int i = 0; i < k; i++) {
    cout << E[i] << endl;
  }
  // for (int i = 0; i < x; i++) {
  //   for (int j = 0; j < y; j++) {
  //     for (int k = 0; k < z; k++) {
  //       PQ.push(A[i] + B[j] + C[k]);
  //     }
  //   }
  // }

  // for (int i = 0; i < k; i++) {
  //   cout << PQ.top() << endl;
  //   PQ.pop();
  // }
}


Compiler output:
/tmp/ccsxphuI.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x32f): relocation truncated to fit: R_X86_64_PC32 against symbol `PQ' defined in .bss section in /tmp/ccsxphuI.o
a.cc:(.text+0x348): relocation truncated to fit: R_X86_64_PC32 against symbol `PQ' defined in .bss section in /tmp/ccsxphuI.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long
#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];
int A[1100];
int B[1100];
int C[1100];
int D[1000100];
int E[1000000100];

priority_queue<int> PQ;

signed main() {
  int x, y, z, k; 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];
  }

  int t = 0;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      D[t++] = A[i] + B[j];
    }
  }

  sort(D, D+t);
  reverse(D, D+t);

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

  sort(E, E+m);
  reverse(E, E+m);
  for (int i = 0; i < k; i++) {
    cout << E[i] << endl;
  }
  // for (int i = 0; i < x; i++) {
  //   for (int j = 0; j < y; j++) {
  //     for (int k = 0; k < z; k++) {
  //       PQ.push(A[i] + B[j] + C[k]);
  //     }
  //   }
  // }

  // for (int i = 0; i < k; i++) {
  //   cout << PQ.top() << endl;
  //   PQ.pop();
  // }
}


Compiler output:
/tmp/cc5Y690U.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x32f): relocation truncated to fit: R_X86_64_PC32 against symbol `PQ' defined in .bss section in /tmp/cc5Y690U.o
a.cc:(.text+0x348): relocation truncated to fit: R_X86_64_PC32 against symbol `PQ' defined in .bss section in /tmp/cc5Y690U.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define FOR(idx, begin, end) for(int idx = (int)(begin); idx < (int)(end); ++idx)

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

using namespace std;
typedef long long lint;

const int MOD = 100000007;
const int INF = 1 << 29;
const double EPS = 1e-9;


int main() {

	cin.tie(0);
  	sync_with_stdio(false);

	lint X, Y, Z, K;
	cin >> X >> Y >> Z >> K;

	vector<lint> A(X), B(Y), C(Z), ans(K);
	FOR(i, 0, X)cin >> A[i];
	FOR(i, 0, Y)cin >> B[i];
	FOR(i, 0, Z)cin >> C[i];

	sort(A.begin(), A.end(), greater<lint>());
	sort(B.begin(), B.end(), greater<lint>());
	sort(C.begin(), C.end(), greater<lint>());


	FOR(a,0,X)FOR(b,0,Y)FOR(c,0,Z){
		if ((a + 1)*(b + 1)*(c+1)<=K) ans.emplace_back(A[a] + B[b] + C[c]);
	}

	sort(ans.begin(), ans.end(), greater<lint>());
	FOR(i, 0, K) cout << ans[i] << "\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'sync_with_stdio' was not declared in this scope
   31 |         sync_with_stdio(false);
      |         ^~~~~~~~~~~~~~~
Language: C++

# include <iostream>
# include <vector>

typedef long long ll;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> a(x), b(y), c(z);
    for (int i = 0; i < x; i++) cin >> a[i];
    for (int i = 0; i < y; i++) cin >> b[i];
    for (int i = 0; i < z; i++) cin >> c[i];
    sort(a.begin(), a.end(), greater<>());
    sort(b.begin(), b.end(), greater<>());
    sort(c.begin(), c.end(), greater<>());
    vector<ll> ab;
    for (int i = 0; i < min(k, x); i++) {
        for (int l = 0; l < min(k, y); l++) {
            ab.push_back(a[i] + b[l]);
        }
    }
    sort(ab.begin(), ab.end(), greater<>());
    vector<ll> abc;
    for (int i = 0; i < min(k, x * y); i++) {
        for (int l = 0; l < min(k, z); l++) {
            abc.push_back(ab[i] + c[l]);
        }
    }
    sort(abc.begin(), abc.end(), greater<>());
    for (int i = 0; i < k; i++) cout << abc[i] << endl;
    return 0;
}


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

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

int main() {
    int X, Y, Z, K; cin >> X >> Y >> Z >> K;
    vector<ll> A(X), B(Y), C(Z);
    for (int i = 0; i < X; i++) cin >> A[i];
    for (int i = 0; i < Y; i++) cin >> B[i];
    for (int i = 0; i < Z; i++) cin >> C[i];
    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    sort(C.rbegin(), C.rend());
    priority_queue<ll> ans;
    for (ll i = 0; i < X; i++) {
        for (ll j = 0; j < Y; j++) {
            for (ll k = 0; k < Z; k++) {
                if (i * j * k > m) break;
                ans.push(A[i] + B[j] + C[k]);
            }
        }
    }
    for (int i = 0; i < K; i++) {
        cout << ans.top() << endl;
        ans.pop();
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'm' was not declared in this scope
   19 |                 if (i * j * k > m) break;
      |                                 ^
Language: C++

#include <iostream>
#include <queue>
#include <map>
#include <functional>
#include <algorithm>

using namespace std;

#define MAX_N 1000
#define MAX_K 3000

typedef long long ll;

typedef struct {
  ll value;
  int ia;
  int ib;
  int ic;
} cake;

typedef struct cake_idx_t {
  int ia;
  int ib;
  int ic;
  bool operator <(const cake_idx_t& rhs) const {
    return tie(ia, ib, ic) < tie(rhs.ia, rhs.ib, rhs.ic);
  }
} cake_idx;

bool comp(cake c1, cake c2) { return c1.value < c2.value; }

int X, Y, Z, K;
ll a[MAX_N];
ll b[MAX_N];
ll c[MAX_N];
priority_queue<
  cake,
  vector<cake>,
  function<bool(cake, cake)>
> pq(comp);

//「狭義の弱順序」でないといけないらしい
//ここではまった（等しいではない）
//微妙に合わない... (重複の判定ができない？）
//countが効かなそう
map<cake_idx, bool> pq_flag;

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

  for(int i=0; i<X; i++) cin >> a[i]; sort(a, a + X, greater<ll>());
  for(int i=0; i<Y; i++) cin >> b[i]; sort(b, b + Y, greater<ll>());
  for(int i=0; i<Z; i++) cin >> c[i]; sort(c, c + Z, greater<ll>());

  //キューに入れる
  pq.push({a[0] + b[0] + c[0], 0, 0, 0});
  pq_flag.insert(make_pair(cake_idx {0, 0, 0}, true));
  //  cout << pq_flag.count(cake_idx {0,0,0}) << endl;
  //  cout << pq_flag.at(cake_idx {0,0,0}) << endl;

  for(int i=0; i<K; i++) {
    cake ck = pq.top();
    pq.pop();
    if(ck.ia X+ 1 < X && pq_flag.count(cake_idx {ck.ia + 1, ck.ib, ck.ic}) == 0) {
      pq.push({a[ck.ia + 1] + b[ck.ib] + c[ck.ic], ck.ia + 1, ck.ib, ck.ic});
      pq_flag.insert(make_pair(cake_idx {ck.ia + 1, ck.ib, ck.ic}, true));
    }
    if(ck.ib + 1 < Y && pq_flag.count(cake_idx {ck.ia, ck.ib + 1, ck.ic}) == 0) {
      pq.push({a[ck.ia] + b[ck.ib + 1] + c[ck.ic], ck.ia, ck.ib + 1, ck.ic});
      pq_flag.insert(make_pair(cake_idx {ck.ia, ck.ib + 1, ck.ic}, true));
    }
    if(ck.ic + 1 < Z && pq_flag.count(cake_idx {ck.ia, ck.ib, ck.ic + 1}) == 0) {
      pq.push({a[ck.ia] + b[ck.ib] + c[ck.ic + 1], ck.ia, ck.ib, ck.ic + 1});
      pq_flag.insert(make_pair(cake_idx {ck.ia, ck.ib, ck.ic + 1}, true));
    }

    cout << ck.value << endl;

    if(pq.empty()) break;
  }
    
  return 0;
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:64:13: error: expected ')' before 'X'
   64 |     if(ck.ia X+ 1 < X && pq_flag.count(cake_idx {ck.ia + 1, ck.ib, ck.ic}) == 0) {
      |       ~     ^~
      |             )
Language: Java

import java.util.*;
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 d=sc.nextInt();		

		long[] a=new long[x];
		long[] b=new long[y];
		long[] c=new long[z];
		for(int i=0;i<x;i++){
			a[i]=sc.nextLong();
		}
		for(int i=0;i<y;i++){
			b[i]=sc.nextLong();
		}
		for(int i=0;i<z;i++){
			c[i]=sc.nextLong();
		}
		Arrays.sort(a);
		Arrays.sort(b);
		Arrays.sort(c);
		
		PriorityQueue<Long> r=new PriorityQueue<>();
		r.add(-1L);

		for(int i=x-1;i>=0;--i){
			if(r.peek()>a[i]+b[y-1]+c[z-1])
				break;
			for(int j=y-1;j>=0;--j){
				if(r.peek()>a[i]+b[j]+c[z-1])
					break;
					for(int k=z-1;k>=0;--k){
						if(r.peek()>a[i]+b[j]+c[k])
							break;

						r.add(a[i]+b[j]+c[k]);
						if(r.size()>d)
							r.poll();
					}
				}
			}
		}
		r.stream().sorted(Comparator.reverseOrder()).forEach(System.out::println);
	}
	
}

Compiler output:
Main.java:46: error: <identifier> expected
		r.stream().sorted(Comparator.reverseOrder()).forEach(System.out::println);
		        ^
Main.java:46: error: ';' expected
		r.stream().sorted(Comparator.reverseOrder()).forEach(System.out::println);
		          ^
Main.java:49: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++


#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include<deque>
#include<stdlib.h>
#include <algorithm>
#include<set>
#include <limits>
#include<iomanip>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define ll long long
#define d_5 100000
#define d9_7 1000000007
int main(void){
  int x,y,z,k;
  cin >> x>>y>>z>>k;
  vector<ll> a(x,0);
  vector<ll> b(y,0);
  vector<ll> c(z,0);
  rep(i,x){
    cin >> a[i];
  }
  rep(i,y){
    cin >> b[i];
  }
  rep(i,z){
    cin >> c[i];
  }
  sort(a.begin(),a.end(),greater<ll>());
  sort(b.begin(),b.end(),greater<ll>());
  sort(c.begin(),c.end(),greater<ll>());
  //rep(i,z)cout<<c[i]<<endl;
  /*int nowa=0,nowb=0,nowc=0;
  rep(i,k){
    cout<<a[nowa]+b[nowb]+c[nowc]<<endl;
    if((nowa!=x-1)&&(a[nowa+1]>b[nowb+1] && a[nowa+1]>c[nowc+1] && nowa<x-1 || nowc==z-1&&a[nowa+1]>b[nowb+1] || nowb==y-1 && a[nowa+1]>c[nowc+1] || nowb==y-1 && nowc==z-1)){
      nowa++;
    }else if((b[nowb+1]>c[nowc+1] && nowb < y-1 || nowc==z-1)&&(nowb!=y-1)){
      nowb++;
    }else{
      nowc++;
    }
  }*/
  multiset<ll> cost;
  for(int nowa,x){
    for(int nowb,y){
      cost.insert(a[nowa]+b[nowb]);
    }
  }
  /*for(auto itr=cost.begin();itr!=cost.end();++itr){
    cout<<*itr<<endl;
  }*/
  /*multiset<ll,greater<ll>> cost2;
  rep(nowc,z){
    int cnt=0;
    for(auto itr=cost.begin();cnt<k&&itr!=cost.end();++itr){
      cost2.insert(c[nowc]+*itr);
      cnt++;
    }
  }
  int cc=0;
  for(auto itr=cost2.begin();cc<k&&itr!=cost2.end();++itr){
    cout<<*itr<<endl;
    cc++;
  }*/
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: expected ';' before ')' token
   52 |   for(int nowa,x){
      |                 ^
      |                 ;
a.cc:52:17: error: expected primary-expression before ')' token
a.cc:52:17: error: expected ';' before ')' token
   52 |   for(int nowa,x){
      |                 ^
      |                 ;
a.cc:53:19: error: expected ';' before ')' token
   53 |     for(int nowb,y){
      |                   ^
      |                   ;
a.cc:53:19: error: expected primary-expression before ')' token
a.cc:53:19: error: expected ';' before ')' token
   53 |     for(int nowb,y){
      |                   ^
      |                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
 int $(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }

signed main(){
  int a,b,c,d,x=0;
  cin>>a>>b>>c>>d;
  vector<int> e(a),f(b),g(c),h;
  for(int i=0;i<a;i++)
    cin>>e.at(i);
  for(int i=0;i<b;i++)
    cin>>f.at(i);
  for(int i=0;i<c;i++)
    cin>>g.at(i);
  sort(e.begin(),e.end());
  reverse(e.begin(),e.end());
  sort(f.begin(),f.end());
  reverse(f.begin(),f.end());
  sort(g.begin(),g.end());
  reverse(g.begin(),g.end());
  int A=e.at(0)-e.at(1);
  int B=f.at(0)-f.at(1);
  int C=g.at(0)-g.at(1);
  for(int i=0;i<a&&x<50000000;i=i){
    for(int j=0;j<b&&x<50000000;j=j){
      for(int k=0;k<c&&x<50000000;k=k){
 //       if(A==)
        A=e.at(i)-e.at(i+1);
        B=f.at(j)-f.at(j+1);
        C=g.at(k)-g.at(k+1);
        h.push_back(e.at(i)+f.at(j)+g.at(k));
        if(i!=a-1){
        if(A<=B&&A<=C){
          i++;
          x++;
        }
        }
        else(j!=b-1){
         if(B<=A&&B<=C){
           j++;
           x++;
         }
        }
        else{
          k++;
          x++;
        }
      }
    }
  }
  sort(h.begin(),h.end());
  reverse(h.begin(),h.end());
    for(int i=0;i<d;i++){
      cout<<h.at(i)<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:21: error: expected ';' before '{' token
   44 |         else(j!=b-1){
      |                     ^
      |                     ;
a.cc:50:9: error: 'else' without a previous 'if'
   50 |         else{
      |         ^~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.StringTokenizer;

public class trms {
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String args[]){
        FastReader in = new FastReader();
        int x = in.nextInt();
        int y = in.nextInt();
        int z = in.nextInt();
        int k = in.nextInt();

        ArrayList<Long> xs = new ArrayList<>();
        ArrayList<Long> ys = new ArrayList<>();
        ArrayList<Long> zs = new ArrayList<>();
        ArrayList<Long> ttl = new ArrayList<>();
        ArrayList<Long> firstKs = new ArrayList<>();

        for (int i = 0; i < x; i++){
            xs.add(in.nextLong());
        }
        for (int i = 0; i < y; i++){
            ys.add(in.nextLong());
        }
        for (int i = 0; i < z; i++){
            zs.add(in.nextLong());
        }
    }
}


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

#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=(a-1); (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;
 
using namespace std;
 
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
 
 
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll X,Y,Z,K,tmp;
  cin>>X>>Y>>Z>>K;
  vll A,B,C;
  REP(i,X){cin>>tmp;A.push_back(tmp);}
  REP(i,Y){cin>>tmp;B.push_back(tmp);}
  REP(i,Z){cin>>tmp;C.push_back(tmp);}
  sort(ALL(A),greater<ll>());
  sort(ALL(B),greater<ll>());
  sort(ALL(C),greater<ll>());
  vll rank,rank2;
  int a=0,b=0;
  REP(i,X)REP(j,Y){
    rank2.push_back(A[i]+B[j]);
  }
  sort(ALL(rank2),greater<ll>());
  
  REP(i,K){
    REP(j,Z){
      rank.push_back(rank2[i]+C[j]);
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:44:4: error: expected '}' at end of input
   44 |   }
      |    ^
a.cc:21:11: note: to match this '{'
   21 | int main(){
      |           ^
Language: C++

#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

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

    ll req[x * y * z];
    for (ll i = 0; i < x * y * z; i++) req[i] = 0;

    ll t = 0;
    for (ll i = 0; i < x; i++) {
        for (ll j = 0; j < y; j++) {
            for (ll k = 0; k < z; k++) {
                req[t] = a[i] + b[j] + c[k];
                ++t;
            }
        }
    }
    sort(req, req + x * y * z);
    for (ll i = x * y * z - 1; i >= x * y * z - k; i--) cout << req[i] << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()
 
int main(){ cin.tie(0); ios::sync_with_stdio(false);
    lint X = in, Y = in, Z = in, K = in;
    vector<lint> A(X), B(Y), C(Z);
    rep( i, X ) A[i] = in; sort( all(A), greater<lint>() );
    rep( i, Y ) B[i] = in; sort( all(B), greater<lint>() );
    rep( i, Z ) C[i] = in; sort( all(C), greater<lint>() );
 
    vector<lint> ans(0);
    rep( x, X ) rep( y, Y ) rep( z, Z ) {
        if( (x+1)*(y+1)*(z+1) <= K ) ans.push_back( A[x]+B[y]+C[z] );
        else break;
    }
 
    sort( all(ans), greater<lint>() );
    rep( i, K ) cout << ans[i] << "\n";
}
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(v)    begin(v), end(v)
#define in        []{lint n; cin>>n; return n;}()

int main(){ cin.tie(0); ios::sync_with_stdio(false);
    lint X = in, Y = in, Z = in, K = in;
    vector<lint> A(X), B(Y), C(Z);
    rep( i, X ) A[i] = in; sort( all(A), greater<lint>() );
    rep( i, Y ) B[i] = in; sort( all(B), greater<lint>() );
    rep( i, Z ) C[i] = in; sort( all(C), greater<lint>() );

    vector<lint> ans(0);
    rep( x, X ) rep( y, Y ) rep( z, Z ) {
        if( (x+1)*(y+1)*(z+1) <= K ) ans.push_back( A[x]+B[y]+C[z] );
        else break;
    }

    sort( all(ans), greater<lint>() );
    rep( i, K ) cout << ans[i] << "\n";
}


Compiler output:
a.cc:31:5: error: redefinition of 'int main()'
   31 | int main(){ cin.tie(0); ios::sync_with_stdio(false);
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main(){ cin.tie(0); ios::sync_with_stdio(false);
      |     ^~~~
Language: C++

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

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

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

int main()
{
  int x, y, z, k; cin>>x>>y>>z>>k;
  ll a[x], b[y], c[z];
  for(int i=0; i<x; i++) cin>>a[i];
  for(int i=0; i<y; i++) cin>>b[i];
  for(int i=0; i<z; i++) cin>>c[i];
  sort(a,a+x,greater<ll>()); sort(b,b+y,greater<ll>()); sort(c,c+z,greater<ll>());
  priority_queue<ll>pq;
  for(int i=0; i<x; i++)
  {
    for(int j=0; j<y; j++)
    {
      pq.push(a[x]+b[j]);
    }
  }
  priority_queue<ll>res;
  int cnt=0;
  while(!pq.empty() && cnt < 3000)
  {	
    ll top=pq.top(); pq.pop(); cnt++;
    for(int i=0; i<z; i++) res.push(c[i]+top)l
  }
  cnt=0;
  while(cnt < k)
  {
    ll top=res.top(); res.pop(); cnt++;
    cout<<top<<" ";
  }
  cout<<endl;
}
  
  
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:26:46: error: expected ';' before 'l'
   26 |     for(int i=0; i<z; i++) res.push(c[i]+top)l
      |                                              ^
      |                                              ;