Language: C++

// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")

//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

// -------------------</optimizations>--------------------
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define d long double
#define pii pair<int,int>
#define pb push_back
#define pf push_front
#define cases int t;cin>>t;while(t--)
#define N 100003
#define M 103
#define inf LLONG_MAX
//int mod=1e9+7;
//int mod=998244353;

signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int x,y,z,k;
    cin>>x>>y>>z>>k;
    int a[x+1],b[y+1],c[z+1],i,j;
    for(i=1;i<=x;++i)
        cin>>a[i];
    sort(a+1,a+x+1);
    for(i=1;i<=y;++i)
        cin>>b[i];
    sort(b+1,b+y+1);
    for(i=1;i<=z;++i)
        cin>>c[i];

    vector<int> h;  h.clear();
    for(i=1;i<=x;++i)
    {
        for(j=1;j<=y;++j)
        {
            h.pb(a[i]+b[j]);
        }
    }
    sort(h.begin(),h.end(),greater<int>());
    vector<int> f;  f.clear();
    for(i=0;i<min(k,h.size());++i)
    {
        for(j=1;j<=z;++j)
        {
            f.pb(h[i]+c[j]);
        }
    }
    sort(f.begin(),f.end(),greater<int>());
    i=0;
    while(k--)
    {
        cout<<f[i++]<<"\n";
    }


    return 0;
}


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