Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;

int calc(vi v,int a,int b,int c, vi l){
  int x = 0,y = 0,z = 0;
  int cnt = 0;
  rep0(i,v.size()){
    if(v[i] == 0){
      if(x != 0){
        cnt++;
      }
      x += l[i];
    }
    if(v[i] == 1){
      if(y != 0){
        cnt++;
      }
      y += l[i];
    }
    if(v[i] == 2){
      if(z != 0){
        cnt++;
      }
      z += l[i];
    }
  }
  return abs(a-x)+abs(b-y)+abs(c-z)+cnt*10;
}

int main(){
  int n,a,b,c;  cin >> n >> a >> b >> c;
  vi l(n);
  ll ans = 0;
  rep0(i,n){
    cin >> l[i];
  }
  ans = 10e8;;
  for(int i = 0; i < (1 << 2*n); i++){
    vi v(n);
    rep0(j,n){
      v[j] = (i >> j*2) & 3;
    }
    ans = min(ans,calc(v,a,b,c,l));
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:14: error: no matching function for call to 'min(ll&, int)'
   70 |     ans = min(ans,calc(v,a,b,c,l));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 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:70:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   70 |     ans = min(ans,calc(v,a,b,c,l));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~
/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:70:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   70 |     ans = min(ans,calc(v,a,b,c,l));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~