Language: C++

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define MOD 1000000007


#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()å
#define rall(i) (i).begin(),(i).end(),greater<int>()


#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T> void print(T x) { std::cout << x << '\n'; }
 
//typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
//#define int long long

class num{
public:
    int a,b,c;

    num(int _a,int _b,int _c){
        a=_a;
        b=_b;
        c=_c;
    }

    bool operater<(const num& other) const {
        return a < other.a;
    }

};


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

    vector<int> a(x);
    vector<int> b(x);
    vector<int> c(x);

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

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

    a.pb((int)-1e17);
    b.pb((int)-1e17);
    c.pb((int)-1e17);


    priority_queue<pair<int,num>> pq;
    pq.pb(mp(a[0]+b[0]+c[0],num(a[0],b[0],c[0])));

    vector<int> ans;
    set<int> index;

    while(ans.size()<k){
        auto v = pq.top();pq.pop();
        ans.pb(v.first);

        int a2 = v.second.a;
        int b2 = v.second.b;
        int c2 = v.second.c;


        rep(i,3){
            if(i==0){a2++;}
            if(i==1){b2++;}
            if(i==2){c2++;}
            int hash = (a2<<20)+(b2<<10)+c2;
            if(index.find(hash)==index.end()){
                index.insert(hash);
                pq.pb(mp(a[a2]+b[b2]+c[c2],num(a[a2],b[b2],c[c2])));
            }
        }

    }


    rep(i,k){
        cout << ans[i] <<endl;
    }
 
    return 0;
 
}


Compiler output:
a.cc:41:10: error: expected ';' at end of member declaration
   41 |     bool operater<(const num& other) const {
      |          ^~~~~~~~
      |                  ;
a.cc:41:18: error: expected unqualified-id before '<' token
   41 |     bool operater<(const num& other) const {
      |                  ^
a.cc: In function 'int main()':
a.cc:20:12: error: 'class std::priority_queue<std::pair<long long int, num> >' has no member named 'push_back'
   20 | #define pb push_back
      |            ^~~~~~~~~
a.cc:78:8: note: in expansion of macro 'pb'
   78 |     pq.pb(mp(a[0]+b[0]+c[0],num(a[0],b[0],c[0])));
      |        ^~
a.cc:20:12: error: 'class std::priority_queue<std::pair<long long int, num> >' has no member named 'push_back'
   20 | #define pb push_back
      |            ^~~~~~~~~
a.cc:99:20: note: in expansion of macro 'pb'
   99 |                 pq.pb(mp(a[a2]+b[b2]+c[c2],num(a[a2],b[b2],c[c2])));
      |                    ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h: In instantiation of 'constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&) [with _T1 = long long int; _T2 = num]':
/usr/include/c++/14/bits/stl_function.h:405:20:   required from 'constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = std::pair<long long int, num>]'
  405 |       { return __x < __y; }
      |                ~~~~^~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30:   required from 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<long long int, num>*, std::vector<std::pair<long long int, num>, std::allocator<std::pair<long long int, num> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<long long int, num>*, std::vector<std::pair<long long int, num>, std::allocator<std::pair<long long int, num> > > >; _Compare = std::less<std::pair<long long int, num> >]'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:232:14:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<long long int, num>*, vector<pair<long long int, num>, allocator<pair<long long int, num> > > >; _Distance = long int; _Tp = pair<long long int, num>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<less<pair<long long int, num> > >]'
  232 |           if (__comp(__first + __secondChild,
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
  233 |                      __first + (__secondChild - 1)))
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:264:25:   required from 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<pair<long long int, num>*, vector<pair<long long int, num>, allocator<pair<long long int, num> > > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<less<pair<long long int, num> > >]'
  264 |       std::__adjust_heap(__first, _DistanceType(0),
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
  265 |                          _DistanceType(__last - __first),
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266 |                          _GLIBCXX_MOVE(__value), __comp);
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:333:19:   required from 'void std::pop_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<pair<long long int, num>*, vector<pair<long long int, num>, allocator<pair<long long int, num> > > >; _Compare = less<pair<long long int, num> >]'
  333 |           std::__pop_heap(__first, __last, __last, __cmp);
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:774:15:   required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = std::pair<long long int, num>; _Sequence = std::vector<std::pair<long long int, num>, std::allocator<std::pair<long long int, num> > >; _Compare = std::less<std::pair<long long int, num> >]'
  774 |         std::pop_heap(c.begin(), c.end(), comp);
      |         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:84:33:   required from here
   84 |         auto v = pq.top();pq.pop();
      |                           ~~~~~~^~
/usr/include/c++/14/bits/stl_pair.h:1047:57: error: no match for 'operator<' (operand types are 'const num' and 'const num')
 1047 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                                              ~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1045 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_pair.h:1047:57: note:   'const num' is not derived from 'const std::pair<_T1, _T2>'
 1047 |              || (!(__y.first < __x.first) && __x.second < __y.second); }
      |                                              ~~~~~~~~~~~^~~~~~~~~~~~