Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

vector<int> l;
int ia,ib,ic;

int solve(int a,int b,int c,int index,int cost) {
  if(index == l.size())
    if(ia == a || ib == b || ic == c) return 112345678;
    else return abs(a) + abs(b) + abs(c) + cost;
  return min(solve(a-l[index], b, c, index + 1, cost + 10),
             solve(a, b-l[index], c, index + 1, cost + 10),
             solve(a, b, c-l[index], index + 1, cost + 10),
             solve(a, b, c, index + 1, cost + 10));
}

int main(void)
{
  int n;
  cin >> n >> ia >> ib >> ic;
  REP(i, n) {
    int x;
    cin >> x;
    l.push_back(l);
  }
  cout << solve(a,b,c,0,-30) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int solve(int, int, int, int, int)':
a.cc:15:13: error: no matching function for call to 'min(int, int, int, int)'
   15 |   return min(solve(a-l[index], b, c, index + 1, cost + 10),
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   16 |              solve(a, b-l[index], c, index + 1, cost + 10),
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   17 |              solve(a, b, c-l[index], index + 1, cost + 10),
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   18 |              solve(a, b, c, index + 1, cost + 10));
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:   candidate expects 2 arguments, 4 provided
/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, 4 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, 4 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:   candidate expects 2 arguments, 4 provided
a.cc: In function 'int main()':
a.cc:28:16: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>&)'
   28 |     l.push_back(l);
      |     ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:30:17: error: 'a' was not declared in this scope
   30 |   cout << solve(a,b,c,0,-30) << endl;
      |                 ^
a.cc:30:19: error: 'b' was not declared in this scope
   30 |   cout << solve(a,b,c,0,-30) << endl;
      |                   ^
a.cc:30:21: error: 'c' was not declared in this scope
   30 |   cout << solve(a,b,c,0,-30) << endl;
      |                     ^