Language: C++

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 510000;
const int INF = 1e9;
const double pi=acos(-1);

int main(){
  int a,b,c,x,y;
  cin >> a >> b >> c >> x >> y;
  int ans=0;
  if(x==y){
    if(2*c<=a && 2*c<=b){
      ans = x*2*c;
    }
    if(2*c>a && 2*c >b){
      ans = a*x+b*y;
    }
    if(2*c>a && 2*c <=b){
      ans=INF;
      rep(i,x+1){
        ans=min(2*c*i+(x-i)*a,ans);
      }
    }
    if(2*c<=a && 2*c >b){
      ans=INF;
      rep(i,x+1){
        ans=min(2*c*i+(y-i)*b,ans);
      }
    }
  }
  if(x>y){
    ans = y*min(a,2*c)+y*min(b,2*c);
    x-=y;
    ans += min(a*x,x*2*c);
  }
  if(x<y){
    ans = min((a+b)*x,x*2*c);
    y-=x;
    ans += min(b*y,y*2*c);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: no matching function for call to 'min(long long int, int&)'
   24 |         ans=min(2*c*i+(x-i)*a,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~
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:24:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   24 |         ans=min(2*c*i+(x-i)*a,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~
/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:24:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   24 |         ans=min(2*c*i+(x-i)*a,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~
a.cc:30:16: error: no matching function for call to 'min(long long int, int&)'
   30 |         ans=min(2*c*i+(y-i)*b,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~
/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:30:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   30 |         ans=min(2*c*i+(y-i)*b,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~
/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:30:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   30 |         ans=min(2*c*i+(y-i)*b,ans);
      |             ~~~^~~~~~~~~~~~~~~~~~~