Language: C++

#define mx 1000000000
#define ll long long
ll factorialNumInverse[mx+1];
ll naturalNumInverse[mx+1];
ll fact[mx+1];

void inverse_of_number(long long N){
    naturalNumInverse[0]=naturalNumInverse[1]=1;
    for(int i=2;i<=N;i++) naturalNumInverse[i]=naturalNumInverse[mod%i]*(mod-mod/i)%mod;
}

void inverse_of_factorial(ll N){
    factorialNumInverse[0]=factorialNumInverse[1]=1;
    for(int i=2;i<=N;i++) factorialNumInverse[i]=((naturalNumInverse[i]%mod)*(factorialNumInverse[i-1]%mod))%mod;
}

void factorial(ll N){
    fact[0]=1;

    for(int i=1;i<=N;i++) fact[i]=(fact[i-1]*i)%mod;

}

ll nCr(ll n,ll r){
   ll ans=(((fact[n]%mod)*(factorialNumInverse[r])%mod)*(factorialNumInverse[n-r]%mod)%mod;
   return ans;
}

long long bigMod(ll n,ll p){
    if(p==0) return 1;
    if(p%2==0){
       long long ret=bigMod(n,p/2);
       return ((ret%mod)*(ret%mod))%mod;
    }
    else return ((n%mod)*(bigMod(n,p-1)%mod))%mod;
}


int main(){
    int n,a,b,c;
    scanf("%d %d %d",&n,&a,&b);
    inverse_of_number(n);
    inverse_of_factorial(n);
    factorial(n);
    c=bigMod(2,n)-nCr(n,a)-nCr(n,b)-1;
    printf("%d\n",c);

return 0;
}


Compiler output:
a.cc: In function 'void inverse_of_number(long long int)':
a.cc:9:66: error: 'mod' was not declared in this scope
    9 |     for(int i=2;i<=N;i++) naturalNumInverse[i]=naturalNumInverse[mod%i]*(mod-mod/i)%mod;
      |                                                                  ^~~
a.cc: In function 'void inverse_of_factorial(long long int)':
a.cc:14:73: error: 'mod' was not declared in this scope
   14 |     for(int i=2;i<=N;i++) factorialNumInverse[i]=((naturalNumInverse[i]%mod)*(factorialNumInverse[i-1]%mod))%mod;
      |                                                                         ^~~
a.cc: In function 'void factorial(long long int)':
a.cc:20:49: error: 'mod' was not declared in this scope
   20 |     for(int i=1;i<=N;i++) fact[i]=(fact[i-1]*i)%mod;
      |                                                 ^~~
a.cc: In function 'long long int nCr(long long int, long long int)':
a.cc:25:22: error: 'mod' was not declared in this scope
   25 |    ll ans=(((fact[n]%mod)*(factorialNumInverse[r])%mod)*(factorialNumInverse[n-r]%mod)%mod;
      |                      ^~~
a.cc:25:91: error: expected ')' before ';' token
   25 |    ll ans=(((fact[n]%mod)*(factorialNumInverse[r])%mod)*(factorialNumInverse[n-r]%mod)%mod;
      |           ~                                                                               ^
      |                                                                                           )
a.cc: In function 'long long int bigMod(long long int, long long int)':
a.cc:33:21: error: 'mod' was not declared in this scope
   33 |        return ((ret%mod)*(ret%mod))%mod;
      |                     ^~~
a.cc:35:21: error: 'mod' was not declared in this scope
   35 |     else return ((n%mod)*(bigMod(n,p-1)%mod))%mod;
      |                     ^~~
a.cc: In function 'int main()':
a.cc:41:5: error: 'scanf' was not declared in this scope
   41 |     scanf("%d %d %d",&n,&a,&b);
      |     ^~~~~
a.cc:46:5: error: 'printf' was not declared in this scope
   46 |     printf("%d\n",c);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define mx 1000000000