Language: C++

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

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

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

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

}; 



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

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

}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: no matching function for call to 'std::priority_queue<std::pair<long long int, ABC> >::push(ABC)'
   36 |     pq.push(ABC(A[0]+B[0]+C[0],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, ABC>; _Sequence = std::vector<std::pair<long long int, ABC>, std::allocator<std::pair<long long int, ABC> > >; _Compare = std::less<std::pair<long long int, ABC> >; value_type = std::pair<long long int, ABC>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from 'ABC' to 'const std::priority_queue<std::pair<long long int, ABC> >::value_type&' {aka 'const std::pair<long long int, ABC>&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/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, ABC>; _Sequence = std::vector<std::pair<long long int, ABC>, std::allocator<std::pair<long long int, ABC> > >; _Compare = std::less<std::pair<long long int, ABC> >; value_type = std::pair<long long int, ABC>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from 'ABC' to 'std::priority_queue<std::pair<long long int, ABC> >::value_type&&' {aka 'std::pair<long long int, ABC>&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:43:25: error: 'struct std::pair<long long int, ABC>' has no member named 'x'
   43 |         ans.push_back(v.x);
      |                         ^
a.cc:46:21: error: 'struct std::pair<long long int, ABC>' has no member named 'a'
   46 |             int a=v.a;
      |                     ^
a.cc:47:21: error: 'struct std::pair<long long int, ABC>' has no member named 'b'
   47 |             int b=v.b;
      |                     ^
a.cc:48:21: error: 'struct std::pair<long long int, ABC>' has no member named 'c'
   48 |             int c=v.c;
      |                     ^
a.cc:56:24: error: no matching function for call to 'std::priority_queue<std::pair<long long int, ABC> >::push(ABC)'
   56 |                 pq.push(ABC(A[a]+B[b]+C[c],a,b,c));
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, ABC>; _Sequence = std::vector<std::pair<long long int, ABC>, std::allocator<std::pair<long long int, ABC> > >; _Compare = std::less<std::pair<long long int, ABC> >; value_type = std::pair<long long int, ABC>]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from 'ABC' to 'const std::priority_queue<std::pair<long long int, ABC> >::value_type&' {aka 'const std::pair<long long int, ABC>&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/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, ABC>; _Sequence = std::vector<std::pair<long long int, ABC>, std::allocator<std::pair<long long int, ABC> > >; _Compare = std::less<std::pair<long long int, ABC> >; value_type = std::pair<long long int, ABC>]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from 'ABC' to 'std::priority_queue<std::pair<long long int, ABC> >::value_type&&' {aka 'std::pair<long long int, ABC>&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~