Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;

const ll M = 1e9 + 7;

ll power(ll a, ll b) {
  ll x = 1, y = a;
  while (b > 0) {
    if (b % 2) x = (x * y) % M;
    y = (y * y) % M;
    b /= 2;
  }
  return x % M;
}

ll inv(ll a) {
  return power(a, M - 2);
}

vector<ll> f;

ll comb(ll n, ll r) {
  return ((f[n] * inv(f[r])) % M * inv(f[n - r])) % M;
}

int main() {
  ll n, a, b; cin >> n >> a >> b;
  ll ans = (power(2, n) - 1 + M) % M;
  f.resize(min(2LL * (1e5), n));
  f[0] = 1;
  for (int i = 1; i <= min(2LL * (1e5), n); i++) {
    f[i] = (f[i - 1] * i) % M;
  }
  ans = (ans - comb(n, a) + M) % M;
  ans = (ans - comb(n, b) + M) % M;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:15: error: no matching function for call to 'min(double, ll&)'
   30 |   f.resize(min(2LL * (1e5), n));
      |            ~~~^~~~~~~~~~~~~~~~
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:30:15: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'll' {aka 'long long int'})
   30 |   f.resize(min(2LL * (1e5), n));
      |            ~~~^~~~~~~~~~~~~~~~
/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:30:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   30 |   f.resize(min(2LL * (1e5), n));
      |            ~~~^~~~~~~~~~~~~~~~
a.cc:32:27: error: no matching function for call to 'min(double, ll&)'
   32 |   for (int i = 1; i <= min(2LL * (1e5), n); i++) {
      |                        ~~~^~~~~~~~~~~~~~~~
/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:32:27: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'll' {aka 'long long int'})
   32 |   for (int i = 1; i <= min(2LL * (1e5), n); i++) {
      |                        ~~~^~~~~~~~~~~~~~~~
/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:32:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   32 |   for (int i = 1; i <= min(2LL * (1e5), n); i++) {
      |                        ~~~^~~~~~~~~~~~~~~~