Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x,y,z,k;
ll _x,_y,_z; 
ll a[1010],b[1010],c[1010];
ll cnt=1;
ll tot[45000000];
int main() {
	scanf("%d%d%d%d",&x,&y,&z,&k);
	_x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
	for(int i=1;i<=x;i++)
		scanf("%lld",&a[i]);
	for(int i=1;i<=y;i++)
		scanf("%lld",&b[i]);
	for(int i=1;i<=z;i++)
		scanf("%lld",&c[i]);
	sort(a+1,a+1+x);
	sort(b+1,b+1+y);
	sort(c+1,c+1+z);
	for(int i=x;i>=x-_x;i--)
		for(int j=y;j>=y-_y;j--)
			for(int k=z;k>=z-_z;k--)
				tot[cnt++]=a[i]+b[j]+c[k];
	sort(tot+1,tot+cnt);
	for(int i=cnt-1;i>=cnt-k;i--)
		printf("%lld\n",tot[i]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: no matching function for call to 'min(long long int, int)'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |            ~~~^~~~~~~~~
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:11:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |            ~~~^~~~~~~~~
/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:11:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |            ~~~^~~~~~~~~
a.cc:11:31: error: no matching function for call to 'min(long long int, int)'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                            ~~~^~~~~~~~~
/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:11:31: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                            ~~~^~~~~~~~~
/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
/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:11:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                            ~~~^~~~~~~~~
a.cc:11:47: error: no matching function for call to 'min(long long int, int)'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                                            ~~~^~~~~~~~~
/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:11:47: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                                            ~~~^~~~~~~~~
/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
/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:11:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |         _x=min(x-1,100);_y=min(y-1,100);_z=min(z-1,100);
      |                                            ~~~^~~~~~~~~