Language: C++

#include <iostream>
#include <vector>
#include <cmath>

int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
{
    if (i >= N-1) {
        if (a == 0 || b == 0 || c == 0) return 99999999;
        return std::abs(a-A) + std::abs(b-B) + std::abs(c-C) - 30;
    }

    int r0 = rec(i+1, L, a, b, c, A, B, C);
    int r1 = rec(i+1, L, a + L[i], b, c, A, B, C) + 10;
    int r2 = rec(i+1, L, a, b + L[i], c, A, B, C) + 10;
    int r3 = rec(i+1, L, a, b, c + L[i], A, B, C) + 10;

    return std::min({r0, r1, r2, r3});
}


int main()
{
    int N, A, B, C;
    std::cin >> N >> A >> B >> C;

    std::vector<int> L(N);
    for (int i = 0; i < N; i++) std::cin >> L[i];

    int ans = rec(N, 0, L, 0, 0, 0);

    std::cout << ans << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)':
a.cc:12:23: error: cannot convert 'const std::vector<int>' to 'int'
   12 |     int r0 = rec(i+1, L, a, b, c, A, B, C);
      |                       ^
      |                       |
      |                       const std::vector<int>
a.cc:5:20: note:   initializing argument 2 of 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)'
    5 | int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
      |                ~~~~^
a.cc:13:23: error: cannot convert 'const std::vector<int>' to 'int'
   13 |     int r1 = rec(i+1, L, a + L[i], b, c, A, B, C) + 10;
      |                       ^
      |                       |
      |                       const std::vector<int>
a.cc:5:20: note:   initializing argument 2 of 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)'
    5 | int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
      |                ~~~~^
a.cc:14:23: error: cannot convert 'const std::vector<int>' to 'int'
   14 |     int r2 = rec(i+1, L, a, b + L[i], c, A, B, C) + 10;
      |                       ^
      |                       |
      |                       const std::vector<int>
a.cc:5:20: note:   initializing argument 2 of 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)'
    5 | int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
      |                ~~~~^
a.cc:15:23: error: cannot convert 'const std::vector<int>' to 'int'
   15 |     int r3 = rec(i+1, L, a, b, c + L[i], A, B, C) + 10;
      |                       ^
      |                       |
      |                       const std::vector<int>
a.cc:5:20: note:   initializing argument 2 of 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)'
    5 | int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
      |                ~~~~^
a.cc:17:20: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   17 |     return std::min({r0, r1, r2, r3});
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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, 1 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, 1 provided
a.cc: In function 'int main()':
a.cc:29:18: error: too few arguments to function 'int rec(int, int, const std::vector<int>&, int, int, int, int, int, int)'
   29 |     int ans = rec(N, 0, L, 0, 0, 0);
      |               ~~~^~~~~~~~~~~~~~~~~~
a.cc:5:5: note: declared here
    5 | int rec(int N, int i, const std::vector<int>& L, int a, int b, int c, int A, int B, int C)
      |     ^~~