Language: C++

#include <regex>
#include "bits/stdc++.h"
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define INF (INT_MAX / 2)
#define LINF (LLONG_MAX / 2)
#define EPS (1.0e-8)
#define mkpr make_pair
const int MGN = 10;
const int ARY_SZ_MAX = (int)1e7;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>;
using vc = vector<char>; using vvc = vector<vc>;
using vb = vector<bool>; using vvb = vector<vb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>; using psl = pair<string, ll>;


// nCk = n!/((n-k)!*k!)
ll combi_mod(ll n, ll k, const ll MOD) {
    if (k == 0) return 1;
    if (k == 1) return n%MOD;

    // nume,denom を k!%MOD にする
    ll nume = 1, denom = 1;
    FOR(i, 1, k + 1) {
        nume *= i;
        nume %= MOD;
        denom *= i;
        denom %= MOD;
    }
    nume %= MOD;
    denom %= MOD;

    // nume を n!%MOD, denom を (k! * (n-k)!)%MOD にする
    FOR(i, 1, n-k+1) {
        nume *= k + i;
        nume %= MOD;
        denom *= i;
        denom %= MOD;
    }
    nume %= MOD;
    denom %= MOD;

    // フェルマーの小定理を利用して (nume/denom)%MOD を求める
    ll res = nume * pow_mod(denom, MOD - 2, MOD);
    res %= MOD;
    return res;
}

template<ll MOD>
struct ModLL {
    ll val;
    ModLL() :val(0) {}
    ModLL(ll v) : val(v >= 0 ? v % MOD : (MOD - (-v) % MOD) % MOD) {}

    ModLL operator -() const { return ModLL(-val); }

    ModLL& operator +=(const ModLL& r) {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return (*this);
    }
    ModLL operator +(const ModLL& r) const {
        return ModLL(*this) += r;
    }

    ModLL& operator -=(const ModLL& r) {
        val += MOD - r.val;
        if (val >= MOD) val -= MOD;
        return (*this);
    }
    ModLL operator -(const ModLL& r) const {
        return ModLL(*this) -= r;
    }

    ModLL& operator *=(const ModLL& r) {
        val *= r.val;
        if (val >= MOD) val %= MOD;
        return (*this);
    }
    ModLL operator *(const ModLL& r) const {
        return ModLL(*this) *= r;
    }

    ModLL& operator /=(const ModLL& r) {
        (*this) *= r.inv();
        return (*this);
    }
    ModLL operator /(const ModLL& r) const {
        return ModLL(*this) /= r;
    }

    bool operator ==(const ModLL& r) {
        return val == r.val;
    }
    bool operator !=(const ModLL& r) {
        return val != r.val;
    }

    ModLL pow(ll n) const {
        ll tmp = val;
        ll ret = 1;
        while (n > 0) {
            if (n & 0x01) {
                ret *= tmp;
                ret %= MOD;
            }
            tmp = tmp * tmp;
            tmp %= MOD;
            n >>= 1LL;
        }
        return ModLL(ret);
    }

    ModLL inv() const {
        ll a = val, b = MOD, u = 1, v = 0;
        while (b > 0) {
            ll t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        return ModLL(u);
    }

    friend istream& operator >>(istream &is, ModLL<MOD> &r) {
        ll t; is >> t;
        r = ModLL<MOD>(t);
        return is;
    }
    friend ostream& operator <<(ostream &os, const ModLL<MOD> &r) {
        return os << r.val;
    }
};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  const ll MOD = 1e9+7;
  ll N,A,B; cin>>N>>A>>B;

  if (N == 2) {
    cout << 0 << endl;
    return 0;
  }

  ModLL<MOD> two(2);
  ModLL<MOD> ans = two.pow(N);
  ans -= 1;
  ModLL<MOD> NCA(combi_mod(N,A,MOD));
  ans -= NCA;
  ModLL<MOD> NCB(combi_mod(N,B,MOD));
  ans -= NCB;

  cout << ans << endl;


  return 0;
}


Compiler output:
a.cc: In function 'll combi_mod(ll, ll, ll)':
a.cc:48:21: error: 'pow_mod' was not declared in this scope
   48 |     ll res = nume * pow_mod(denom, MOD - 2, MOD);
      |                     ^~~~~~~