criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;

const long long MAX = 5100000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (long long i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    // 前処理
    COMinit();
long long t=0;
    long long n,a,b;
  cin>>n>>a>>b;
  for(long long i=1; i<=n; i++){
if(i!=a && i!=b) t+=COM(n,i);
  }
    cout<<t%MOD<<endl;
}
  

Compiler output:
/tmp/ccVtiUeP.o: in function `COMinit()':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
/tmp/ccVtiUeP.o: in function `COM(int, int)':
a.cc:(.text+0x22e): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVtiUeP.o
a.cc:(.text+0x249): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

const int MAX = 5100000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (long long i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    // 前処理
    COMinit();
long long t=0;
    long long n,a,b;
  cin>>n>>a>>b;
  for(long long i=1; i<=n; i++){
if(i!=a && i!=b) t+=COM(n,i);
  }
    cout<<t%MOD<<endl;
}
  

Compiler output:
a.cc:4:17: warning: overflow in conversion from 'long int' to 'int' changes value from '5100000000' to '805032704' [-Woverflow]
    4 | const int MAX = 5100000000;
      |                 ^~~~~~~~~~
/tmp/ccVk4KBt.o: in function `COMinit()':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
/tmp/ccVk4KBt.o: in function `COM(int, int)':
a.cc:(.text+0x228): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccVk4KBt.o
a.cc:(.text+0x243): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    // 前処理
    COMinit();
long long t=0;
    long long n,a,b;
  cin>>n>>a>>b;
  for(long long i=0; i<=n; i++){
if(i!=a && i!=b) t+=COM(n,i);
    cout<t%MOD<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   36 |     cout<t%MOD<<endl;
      |          ~~~~~^~~~~~
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:28:12: note: to match this '{'
   28 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    // 前処理
    COMinit();
long long t=0;
    long long n,a,b;
  cin>>N>>a>>b;
  for(long long i=0; i<=n; i++){
if(i!=a && i!=b) t+=COM(n,i);
    cout<t%MOD<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'N' was not declared in this scope
   33 |   cin>>N>>a>>b;
      |        ^
a.cc:36:15: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   36 |     cout<t%MOD<<endl;
      |          ~~~~~^~~~~~
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:28:12: note: to match this '{'
   28 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;

long long n,a,b;
cin>>n>>a>>b;
 
vector<long long> fact_inv, inv, Com;
 
/*  init_nCk :二項係数のための前処理
    計算量:O(n)
*/
void init_nCk(int n, int SIZE) {
    fact_inv.resize(SIZE + 5);
    inv.resize(SIZE + 5);
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < SIZE + 5; i++) {
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
    Com.resize(SIZE + 5);
    Com[0] = 1;
    for (int i = 1; i < SIZE + 5; i++) {
        Com[i] = Com[i - 1] * ((n - i + 1) * inv[i] % MOD) % MOD;
    }
}
 
/*  nCk :MODでの二項係数を求める(前処理 int_nCk が必要)
    計算量:O(1)
*/
long long nCk(int k) {
    assert(!(k < 0));
    return Com[k];
}

int main(){

  long long t=0;
  for(long long k=1; k<=n; k++){
    t+=(nCk(k)%MOD);
  }
  long long u=t-nCk(a)-nCk(b);
  cout<<u<<endl;
}

Compiler output:
a.cc:6:1: error: 'cin' does not name a type
    6 | cin>>n>>a>>b;
      | ^~~
Language: C++



#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

#define rep(i,n) for(long long i=0;i<n;i++)
using namespace std;

long long aaa(long long x,long long y)
{
	long long r=1;
	
	for (long long i = 0; i < y; i++)
	{
		r *= (x - i);
	}

	for (long long i = 0; i < y; i++)
	{
		r /= (y - i);
	}

	return r;
}

int main() {
	
	
	long long n, a, b,ans;
	cin >> n >> a >> b;

	ans = 0;

	if (n == 2&& a<=2&&b<=2)
	{
		cout << 0 << endl;

		return 0;
	}

	ans = pow(2, n) - 1;

	ans -= aaa(n, a);
	ans -= aaa(n, b);

	cout << ans % (7 + 1000000000) << endl;

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:44:15: error: 'pow' was not declared in this scope
   44 |         ans = pow(2, n) - 1;
      |               ^~~
Language: C++

N, a, b = map(int, input().split())
mod = 10**9+7

def cmb(n, k):
  ne = 1
  ke = 1
  for i in range(k):
    ne = ne * (n - i) % mod
    ke = ke * (i + 1) % mod
  
  res = ne * pow(ke, (mod - 2), mod) % mod
  return res

result = (pow(2, N, mod) - 1 - cmb(N, a) - cmb(N, b)) % mod
print(result)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, a, b = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
typedef long double ld;
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;

int main()
{
    ll n,a,b;
    cin >> n >> a >> b;
    ll count = 0;
    for (ll bit = 1; bit < (1 << n); bit++)
    {
        if (__builtin_popcount(bit) != a && __builtin_popcount(bit) != b)
        {
          count++;
          count **%= MOD**;
        }
    }
    cout << count % MOD << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: expected primary-expression before '%=' token
   17 |           count **%= MOD**;
      |                   ^~
a.cc:17:27: error: expected primary-expression before ';' token
   17 |           count **%= MOD**;
      |                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;

ll fast(ll a, ll n)
{
  ll ret=1;
  while (n>0)
  {
    if (n & 1)
    {
      ret = ret * a % MOD;
    }
    a = a*a % MOD;
    n = (n>>1);
  }
  return (ret);
}

ll fac(ll n)
{
  ll ret = 1;
  while (n>0)
  {
    ret = ret * n %MOD;
    n--;
  }
  return (ret);
}

ll comb(ll n,ll r)
{
  ll top=1;
  ll bot=1;
  ll ret;
  while (r>0)
  {
    top *= n; top %= MOD;
    bot *= r; bot %= MOD;
    n--;r--;
  }
  ret = top * fast(bot,MOD-2) %MOD;
  return (ret);
}

int main()
{
  ll n,a,b;cin>>n>>a>>b;
  //2^n-nCa-nCbを求めたい
  ll ans = fast(2,n) -1;
  nas %=MOD;
  ans = ans - comb(n,a) +MOD;
  ans %=MOD;
  ans = ans - comb(n,b) +MOD;
  ans %= MOD;
  cout<<ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:3: error: 'nas' was not declared in this scope; did you mean 'ans'?
   52 |   nas %=MOD;
      |   ^~~
      |   ans
Language: C++

#include<iostream>
#include<vector>
using namespace std;

long long int ansall;
long long int mod = 1000000007;

int f(long long int n){
    if (n==1) {
        ansall = 2;
        return ansall;
    }
    else if (n % 2){
        ansall = (f((n-1)/2) % mod) * (f((n-1)/2) % mod) * 2;
        ansall = ansall % mod;
        return ansall;
    }
    else {
        ansall = (f(n/2) % mod) * (f(n/2) % mod) ;
        ansall = ansall % mod;
        return ansall;
    }
}

int main(){
    
    int n,a,b;
    long long int dpa,dpb;
    long long int sum;
    long long int ans;
    long long int mod=1000000007;
    cin >> n >> a >> b;

    sum = f(n);

    long long int ai1, ai2;
    ai1 = n;
    sum = n;
    if (a==1) dpa = n;
    if (b==1) dpb = n;
    for (int i=2; i<=b; i++){ 
        ai2 = ((ai1 * (n-i+1)) / i) % mod;
        if (i==a) dpa = ai2;
        if (i==b) dpb = ai2;
    }
    ans = sum - dpa - dpb;
    cout << ans << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:48:14: error: expected '}' at end of input
   48 |     return 0;
      |              ^
a.cc:25:11: note: to match this '{'
   25 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

long long int ansall;
long long int mod = 1000000007;

int f(long long int n){
    if (n==1) {
        ansall = 2;
        return ansall;
    }
    else if (n % 2){
        ansall = (f((n-1)/2) % mod) * (f((n-1)/2) % mod) * 2;
        ansall = ansall % mod;
        return ansall;
    }
    else {
        ansall = (f(n/2) % mod) * (f(n/2) % mod) ;
        ansall = ansall % mod;
        return ansall;
    }
}

int main(){
    
    int n,a,b;
    long long int dpa,dpb;
    long long int sum;
    long long int ans;
    long long int mod=1000000007;
    cin >> n >> a >> b;

    sum = f(n);

    long long int ai1, ai2;
    ai1 = n;
    sum = n;
    if (a==1) dpa = n;
    if (b==1) dpb = n;
    for (int i=2; i<=n; i++){ 
        ai2 = ((ai1 * (n-i+1)) / i) % mod;
        if (i==a) dpa = ai2;
        if (i==b) dpb = ai2; break;
    }
    ans = sum - dpa - dpb;
    cout << ans << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:48:14: error: expected '}' at end of input
   48 |     return 0;
      |              ^
a.cc:25:11: note: to match this '{'
   25 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
    int n,a,b;
    long long int dpa,dpb;
    long long int sum;
    long long int ans;
    long long int mod=1000000007;
    cin >> n >> a >> b;
    vector<long long int> dp;
    dp[0] = n;
    sum = n;
    for (int i=2; i<=n; i++){ //メモリ的にはアウトっぽいけどせっかく作ったので
        dp[1] = ((dp[0] * (n-i+1)) / i) % mod;
        sum = (sum + dp[1]) % mod;
        if (i==a) dpa = dp[1];
        if (i==b) dpb = dp[1]
    }
    ans = sum - dpa - dpb;
    cout << ans << endl;
    return 0;


    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: expected ';' before '}' token
   19 |         if (i==b) dpb = dp[1]
      |                              ^
      |                              ;
   20 |     }
      |     ~
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n,a,b;
    long long int sum;
    long long int ans;
    long long int mod=1000000007
    cin >> n >> a >> b;
    long long int dp[n];
    dp[1] = n;
    sum = n;
    for (int i=2; i<=n; i++){
        dp[i] = ((dp[i-1] * (n-i+1)) / i) % mod;
        sum = (sum + dp[i]) % mod;
    }
    ans = sum - dp[a] - dp[b];
    cout << ans << endl;
    return 0;


    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'cin'
   11 |     cin >> n >> a >> b;
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

int MOD=1000000007;

//2の累乗(mod)の関数
long long modpow(long long a, int n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//逆元
ll inv(ll a){
	return power(a,MOD-2);
}

//nck
ll nCr(int n, int r) {
    ll bunbo=1,bunshi=1;
	rep(i,r){
		bunbo=bunbo*(r-i)%MOD;
		bunshi=bunshi*(n-i)%MOD;
	}
	
	return bunshi*inv(bunbo)%MOD;
}





int main() {
	int n,a,b;
	cin>>n>>a>>b;
	
	ll ans=modpow(2,n,MOD)-1-nCr(n,a)-nCr(n,b);
	while(ans<0)ans+=MOD;
	
	cout<<ans<<endl;


}

//つぎはぎで一部RE
//modの計算は互いに素のときのみok

Compiler output:
a.cc: In function 'll inv(ll)':
a.cc:21:16: error: 'power' was not declared in this scope
   21 |         return power(a,MOD-2);
      |                ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

int MOD=1000000007;

//2の累乗(mod)の関数
long long modpow(long long a, int n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//逆元
ll inv(ll a){
	return power(a,MOD-2)
}

//nck
ll nCr(int n, int r) {
    ll bunbo=1,bunshi=1;
	rep(i,r){
		bunbo=bunbo*(r-i)%MOD;
		bunshi=bunshi*(n-i)%MOD;
	}
	
	return bunshi*inv(bunbo)%MOD;
}





int main() {
	int n,a,b;
	cin>>n>>a>>b;
	
	ll ans=modpow(2,n,MOD)-1-nCr(n,a)-nCr(n,b);
	while(ans<0)ans+=MOD;
	
	cout<<ans<<endl;


}

//つぎはぎで一部RE
//modの計算は互いに素のときのみok

Compiler output:
a.cc: In function 'll inv(ll)':
a.cc:21:16: error: 'power' was not declared in this scope
   21 |         return power(a,MOD-2)
      |                ^~~~~
a.cc:21:30: error: expected ';' before '}' token
   21 |         return power(a,MOD-2)
      |                              ^
      |                              ;
   22 | }
      | ~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

int MOD=1000000007;

//2の累乗(mod)の関数
long long modpow(long long a, int n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//逆元
ll inv(a){
	return power(a,MOD-2)
}

//nck
ll nCr(int n, int r) {
    ll bunbo=1,bunshi=1;
	rep(i,r){
		bunbo=bunbo*(r-i)%MOD;
		bunshi=bunshi*(n-i)%MOD;
	}
	
	return bunshi*inv(bunbo)%MOD;
}





int main() {
	int n,a,b;
	cin>>n>>a>>b;
	
	ll ans=modpow(2,n,MOD)-1-nCr(n,a)-nCr(n,b);
	while(ans<0)ans+=MOD;
	
	cout<<ans<<endl;


}

//つぎはぎで一部RE
//modの計算は互いに素のときのみok

Compiler output:
a.cc:20:8: error: 'a' was not declared in this scope
   20 | ll inv(a){
      |        ^
a.cc: In function 'll nCr(int, int)':
a.cc:32:26: error: 'inv' cannot be used as a function
   32 |         return bunshi*inv(bunbo)%MOD;
      |                       ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

//2の累乗(mod)の関数
long long modpow(long long a, int n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//nck
long nCr(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}




int main() {
	// 前処理
    COMinit();
	
	int n,a,b;
	cin>>n>>a>>b;
	
	int MOD=1000000007;
	
	cout<<(modpow(2,n,MOD)-1-nCr(n,a)-nCr(n,b))%MOD<<endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'COMinit' was not declared in this scope
   34 |     COMinit();
      |     ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll=long long;

//2の累乗(mod)の関数
long long modpow(long long a, int n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//二項係数(modMOD)
const int MAX = 1000000000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}






int main() {
	// 前処理
    COMinit();
	
	int n,a,b;
	cin>>n>>a>>b;
	
	cout<<modpow(2,n,MOD)-1-(COM(n,a)+COM(n,b))<<endl;


}


Compiler output:
/tmp/ccabffXA.o: in function `COMinit()':
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x82): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x90): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x12b): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x18c): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x1a7): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x1bf): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x20e): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
/tmp/ccabffXA.o: in function `COM(int, int)':
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccabffXA.o
a.cc:(.text+0x2a0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

n,a,b = map(int,input().split())
p = 10**9 + 7
def comb(n,k):
    child = 1
    mother = 1
    for i in range(k):
        child = child * (n-i)%p
        mother = mother * (i+1)%p
    return child * pow(mother,p-2,p) % p
ans = pow(2,n,p) - 1 - comb(n,a) - comb(n,b)
print(ans%p)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,a,b = map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#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 'long long int nCr(long long int, long long int)':
a.cc:28:91: error: expected ')' before ';' token
   28 |    ll ans=(((fact[n]%mod)*(factorialNumInverse[r])%mod)*(factorialNumInverse[n-r]%mod)%mod;
      |           ~                                                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#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]*factorialNumInverse[i-1])%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]*factorialNumInverse[r])%mod*factorialNumInverse[n-r])%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:
/tmp/cc8Dg5eq.o: in function `inverse_of_number(long long)':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
/tmp/cc8Dg5eq.o: in function `inverse_of_factorial(long long)':
a.cc:(.text+0xfd): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc8Dg5eq.o
/tmp/cc8Dg5eq.o: in function `factorial(long long)':
a.cc:(.text+0x191): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0x1b5): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc8Dg5eq.o
a.cc:(.text+0x209): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc8Dg5eq.o
/tmp/cc8Dg5eq.o: in function `nCr(long long, long long)':
a.cc:(.text+0x23f): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc8Dg5eq.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#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]*factorialNumInverse[i-1])%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]*factorialNumInverse[r])%mod*factorialNumInverse[n-r])%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(){
    long long n,a,b,c;
    scanf("%lld %lld %lld",&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("%lld\n",c);

return 0;
}


Compiler output:
/tmp/cc16xvg5.o: in function `inverse_of_number(long long)':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0x16): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
/tmp/cc16xvg5.o: in function `inverse_of_factorial(long long)':
a.cc:(.text+0xfd): relocation truncated to fit: R_X86_64_PC32 against symbol `naturalNumInverse' defined in .bss section in /tmp/cc16xvg5.o
/tmp/cc16xvg5.o: in function `factorial(long long)':
a.cc:(.text+0x191): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0x1b5): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc16xvg5.o
a.cc:(.text+0x209): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc16xvg5.o
/tmp/cc16xvg5.o: in function `nCr(long long, long long)':
a.cc:(.text+0x23f): relocation truncated to fit: R_X86_64_PC32 against symbol `fact' defined in .bss section in /tmp/cc16xvg5.o
collect2: error: ld returned 1 exit status
Language: C++

MOD = 1000000007
NCK_MAX = 510000

fac = [0 for _ in range(NCK_MAX)]; finv = [0 for _ in range(NCK_MAX)]
inv = [0 for _ in range(NCK_MAX)]; facn = [0 for _ in range(NCK_MAX)]

def myPow(x,n,MOD=MOD):
    if n == 0:
        return 1
    elif n % 2 == 0:
        return myPow(x*x%MOD,n//2)
    else:
        return x*myPow(x,n-1)%MOD

def COMinit(n):
    fac[0] = 1; fac[1] = 1
    facn[1] = n
    finv[0] = 1; finv[1]=1
    inv[1]=1
    for i in range(2,NCK_MAX):
        fac[i] = fac[i-1]*i%MOD
        facn[i] = facn[i-1]*(n-i+1)%MOD
        inv[i] = MOD-inv[MOD%i]*(MOD//i)%MOD
        finv[i] = finv[i-1]*inv[i]%MOD

def modinv(a,MOD=MOD):
    return myPow(a,MOD-2)

def COM(n,k):
    if n<k:
         return 0
    elif n<0 and k<0:
         return 0
    return facn[k] * finv[k]%MOD

n,a,b = map(int,input().split())
COMinit(n)
ans = (myPow(2,n)-1+MOD)%MOD
ans = (ans-COM(n,a)+MOD)%MOD
ans = (ans-COM(n,b)+MOD)%MOD
print(ans)


Compiler output:
a.cc:1:1: error: 'MOD' does not name a type
    1 | MOD = 1000000007
      | ^~~
a.cc:4:36: error: 'finv' does not name a type
    4 | fac = [0 for _ in range(NCK_MAX)]; finv = [0 for _ in range(NCK_MAX)]
      |                                    ^~~~
a.cc:5:36: error: 'facn' does not name a type
    5 | inv = [0 for _ in range(NCK_MAX)]; facn = [0 for _ in range(NCK_MAX)]
      |                                    ^~~~
a.cc:16:17: error: 'fac' does not name a type
   16 |     fac[0] = 1; fac[1] = 1
      |                 ^~~
a.cc:18:18: error: 'finv' does not name a type
   18 |     finv[0] = 1; finv[1]=1
      |                  ^~~~
Language: C++

include<stdio.h>

long long modpow(long long x,long long n,long long mod){
  if(n == 1) return x % mod;
  if(n % 2 == 1)return (x * modpow(x,n-1,mod)) % mod;
  long long t = modpow(x,n/2,mod);
  return (t*t) % mod;
}


int main(){
  int i;
  long long a,b,n,mod = 1e9+7;
  scanf("%d %d %d",&n,&a,&b);

  long ans, base_ans,a_ans,b_ans;
  int a_head = 1,b_head = 1;
  int a_bottom,b_bottom;

  for(i=0; i<a; i++){
    a_head*=n-i;
    a_bottom*=i+1;
  }
  a_bottom=a_bottom % mod;

  for(i=0; i<b; i++){
    b_head*=n-i;
    b_bottom*=i+1;
  }
  b_bottom=b_bottom % mod;

  a_ans=a_head*modpow(a_bottom, mod-2, mod);
  b_ans=b_head*modpow(b_bottom, mod-2, mod);

  base_ans = modpow(2,n,mod) - 1;
  ans = base_ans - a_ans - b_ans;
  printf("%lld\n",ans);
  return 0;
  }

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'scanf' was not declared in this scope
   14 |   scanf("%d %d %d",&n,&a,&b);
      |   ^~~~~
a.cc:32:16: error: 'modpow' was not declared in this scope
   32 |   a_ans=a_head*modpow(a_bottom, mod-2, mod);
      |                ^~~~~~
a.cc:37:3: error: 'printf' was not declared in this scope
   37 |   printf("%lld\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<stdio.h>
Language: C++

include<stdio.h>

int modpow(long long x,long long n,long long mod){
  if(n == 1) return x % mod;
  if(n % 2 == 1)return (x * modpow(x,n-1,mod)) % mod;
  long long t = modpow(x,n/2,mod);
  return (t*t) % mod;
}


int main(){
  int i;
  long long a,b,n,mod = 1e9+7;
  scanf("%d %d %d",&n,&a,&b);

  long ans, base_ans,a_ans,b_ans;
  int a_head = 1,b_head = 1;
  int a_bottom,b_bottom;

  for(i=0; i<a; i++){
    a_head*=n-i;
    a_bottom*=i+1;
  }
  a_bottom=a_bottom % mod;

  for(i=0; i<b; i++){
    b_head*=n-i;
    b_bottom*=i+1;
  }
  b_bottom=b_bottom % mod;

  a_ans=a_head*modpow(a_bottom, mod-2, mod);
  b_ans=b_head*modpow(b_bottom, mod-2, mod);

  base_ans = modpow(2,n,mod) - 1;
  ans = base_ans - a_ans - b_ans;
  printf("%lld\n",ans);
  return 0;
  }

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'scanf' was not declared in this scope
   14 |   scanf("%d %d %d",&n,&a,&b);
      |   ^~~~~
a.cc:32:16: error: 'modpow' was not declared in this scope
   32 |   a_ans=a_head*modpow(a_bottom, mod-2, mod);
      |                ^~~~~~
a.cc:37:3: error: 'printf' was not declared in this scope
   37 |   printf("%lld\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<stdio.h>
Language: C++

include<stdio.h>

int modpow(long long x,long long n,long long mod){
  if(n == 1) return x % mod;
  if(n % 2 == 1)return (x * modpow(x,n-1,mod)) % mod;
  long long t = modpow(x,n/2,mod);
  return (t*t) % mod;
}


int main(){
  int i;
  long long a,b,n,mod = 1e9+7;
  scanf("%d %d %d",n,a,b);

  long ans, base_ans,a_ans,b_ans;
  int a_head = 1,b_head = 1;
  int a_bottom,b_bottom;

  for(i=0; i<a; i++){
    a_head*=n-i;
    a_bottom*=i+1;
  }
  a_bottom=a_bottom % mod;

  for(i=0; i<b; i++){
    b_head*=n-i;
    b_bottom*=i+1;
  }
  b_bottom=b_bottom % mod;

  a_ans=a_head*modpow(a_bottom, mod-2, mod);
  b_ans=b_head*modpow(b_bottom, mod-2, mod);

  base_ans = modpow(2,n,mod) - 1;
  ans = base_ans - a_ans - b_ans;
  printf("%lld\n",ans);
  return 0;
  }

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'scanf' was not declared in this scope
   14 |   scanf("%d %d %d",n,a,b);
      |   ^~~~~
a.cc:32:16: error: 'modpow' was not declared in this scope
   32 |   a_ans=a_head*modpow(a_bottom, mod-2, mod);
      |                ^~~~~~
a.cc:37:3: error: 'printf' was not declared in this scope
   37 |   printf("%lld\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<stdio.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ

//a^n modをO(logN)で計算
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
// a÷bの余り
int64_t div(int64_t a,int64_t b,int64_t mod){
    return (a%mod)*(modpow(b,mod-2)%mod)%mod;
}

int main(){
    int64_t n,a,b;
    cin>>n>>a>>b;
    //2^n-1-nCa-nCbを何とかして求める
    int64_t ans=modpow(2,n,big)-1;
    //cout<<ans<<endl;
    int64_t cha = 1,moa = 1;
    int64_t chb = 1,mob = 1;
    bool block=true;
    //cout<<(a%big)*(modpow(b,big-2,big)%big)%big<<endl;
    rep(i,a){
        cha = cha*(n-i)%big;
        //cha = (cha%big) * (modpow(a-i,big-2,big)%big) % big;
        cha = div(cha,a-i,big);
    }
    /*
    rep(i,a){
        cha = (cha%big) * (modpow(a-i,big-2,big)%big) % big;
    }
    */
    //cout<<cha<<" "<<moa<<endl;
    rep(i,b){
        chb = chb*(n-i)%big;
        //chb = (chb%big) * (modpow(b-i,big-2,big)%big) % big; 
        chb = div(chb,b-i,big);  
    }
    /*
    rep(i,b){
        chb = (chb%big) * (modpow(b-i,big-2,big)%big) % big;   
    }
    */
    //cout<<chb<<" "<<mob<<endl;
    ans = ans-cha;
    //引き算の結果余りがマイナスになったら10^9+7を足す
    if(ans<0){
        ans += big;
    }
    ans = ans -chb;
    if(ans<0){
        ans += big;
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int64_t div(int64_t, int64_t, int64_t)':
a.cc:21:27: error: too few arguments to function 'long long int modpow(long long int, long long int, long long int)'
   21 |     return (a%mod)*(modpow(b,mod-2)%mod)%mod;
      |                     ~~~~~~^~~~~~~~~
a.cc:10:11: note: declared here
   10 | long long modpow(long long a, long long n, long long mod) {
      |           ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ

//a^n modをO(logN)で計算
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
// a÷bの余り
int64_t div(int64_t a,int64_t b,int64_t mod){
    return (a%mod)*(modpow(b,mod-2)%mod)%mod;
}

int main(){
    int64_t n,a,b;
    cin>>n>>a>>b;
    //2^n-1-nCa-nCbを何とかして求める
    int64_t ans=modpow(2,n,big)-1;
    //cout<<ans<<endl;
    int64_t cha = 1,moa = 1;
    int64_t chb = 1,mob = 1;
    bool block=true;
    //cout<<(a%big)*(modpow(b,big-2,big)%big)%big<<endl;
    rep(i,a){
        cha = cha*(n-i)%big;
        //cha = (cha%big) * (modpow(a-i,big-2,big)%big) % big;
        cha = div(cha,a-i);
    }
    /*
    rep(i,a){
        cha = (cha%big) * (modpow(a-i,big-2,big)%big) % big;
    }
    */
    //cout<<cha<<" "<<moa<<endl;
    rep(i,b){
        chb = chb*(n-i)%big;
        //chb = (chb%big) * (modpow(b-i,big-2,big)%big) % big; 
        chb = div(chb,b-i);  
    }
    /*
    rep(i,b){
        chb = (chb%big) * (modpow(b-i,big-2,big)%big) % big;   
    }
    */
    //cout<<chb<<" "<<mob<<endl;
    ans = ans-cha;
    //引き算の結果余りがマイナスになったら10^9+7を足す
    if(ans<0){
        ans += big;
    }
    ans = ans -chb;
    if(ans<0){
        ans += big;
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int64_t div(int64_t, int64_t, int64_t)':
a.cc:21:27: error: too few arguments to function 'long long int modpow(long long int, long long int, long long int)'
   21 |     return (a%mod)*(modpow(b,mod-2)%mod)%mod;
      |                     ~~~~~~^~~~~~~~~
a.cc:10:11: note: declared here
   10 | long long modpow(long long a, long long n, long long mod) {
      |           ^~~~~~
a.cc: In function 'int main()':
a.cc:37:18: error: cannot convert 'ldiv_t' to 'int64_t' {aka 'long int'} in assignment
   37 |         cha = div(cha,a-i);
      |               ~~~^~~~~~~~~
      |                  |
      |                  ldiv_t
a.cc:48:18: error: cannot convert 'ldiv_t' to 'int64_t' {aka 'long int'} in assignment
   48 |         chb = div(chb,b-i);
      |               ~~~^~~~~~~~~
      |                  |
      |                  ldiv_t
Language: C++

n, a, b = map(int ,input().split())

def inv(k):
    return pow(k, mod - 2, mod)

def comb(n, k):
    bunshi = 1
    bunbo = 1
    for i in range(k):
        bunshi *= (n - i)
        bunbo *= (i + 1)
    return bunshi * inv(bunbo) % mod

mod = 1000000007
all_num = pow(2, n, mod)

ans = all_num - 1 - comb(n, a) - comb(n, b)
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, a, b = map(int ,input().split())
      | ^
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			long n = scan.nextInt();
			long a = scan.nextInt();
			long b = scan.nextInt();
			long goukei = 0;
			goukei+=mod_pow(2,n,mod);
			goukei-=1;
			long A = 1;
			long B = 1;
			long x =1;
			long y = 1;
			
			for(long i = 0;i<a;i++) {
				
				x=x*(n-i)%mod;
				y=y*(a-i)%mod;
				//System.out.println(x);
				//System.out.println(y);
				
				
			}
			A = (x*mod_pow(y,mod-2,mod))%mod;
			
			x=1;
			y=1;
			
			for(long i = 0;i<b;i++) {
				
				x=x*(n-i)%mod;
				y=y*(b-i)%mod;
				
			}
			B = (x*mod_pow(y,mod-2,mod))%mod;
			
			//System.out.println(x);
			//System.out.println(y);
			goukei-=A;
			goukei-=B;
			
			//System.out.println(A);
			//System.out.println(B);
			System.out.println(goukei+mod);
		}
		
		
	}
	
	private static long mod_pow(long x, long n ,long mod) {//Xのn乗を二分累乗法(繰り返し２乗法)で計算modもあり大きくしない
		long res = 1;
		    while(n > 0){
		        if((n&1)==1) {
		        	res = res*x%mod;
		        }
		        x = x*x%mod;
		        n >>= 1;
		    }
		    return res;
	}
	
	//組み合わせを使う際は、限界まで自力でできるか考えてから使う、ex nC2を求める場合自力でできる
	
	
	 /* int n = 1_000_000; //n=100万まで求めるとする
    pre_factorials(n); //1!からn!までの値を持った配列を準備する    
    System.out.println(fastFermatComb(5, 2)); //5C2を計算 -> 出力10
    System.out.println(fastFermatComb(50000, 3000)); //50000C3000を計算 -> 出力890850597 (1e9+7で割った余り)
	
	*mainメソッドはこのように使うことでコンビネーション使える　mod指定されてるので問題によってかえる
	*/
	
	
	
	 //Fast Fermat Combination
    static int mod = (int) 1e9 + 7;
    static long factorials[]; //事前に階乗計算の結果を格納しておく配列

    static void pre_factorials(int n) { //0!〜n!まで求めておく
        factorials = new long[n + 1];
        factorials[0] = 1;
        for (int i = 0; i < n; i++) {
            factorials[i + 1] = (long)(i + 1) * factorials[i] % mod;
        }
    }

    static long fastFermatComb(long a, long b) {
        if (factorials.length == 0)
            System.err.println("error : factorials has not been culculated!! do [pre_factorials] method");
        long af = factorials[(int) a];
        long bf = factorials[(int) b];
        long abf = factorials[(int) (a - b)];
        long res = af * modpow(bf, mod - 2) % mod * modpow(abf, mod - 2) % mod;
        return res;
    }

    //mod条件下の高速pow
    static long modpow(long a, long p) {
        if (p == 0)
            return 1;
        if (p % 2 == 0) {
            long root = modpow(a, p / 2);
            return root * root % mod;
        } else
            return a * modpow(a, p - 1) % mod;
    }
	
	
	
	

Compiler output:
Main.java:109: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
long extgcd( long a)
{
  //拡張ユークリッドの互除法でaのmod b(prime)での逆元をもとめる
  long b = (long)1E9+7;
  long u, v, q, tmp; 
  long x = 1;
  long y = 0; u = 0; v = 1;
  while ( b > 0 ) {
	q = a / b; 
	tmp = u; u = x - q * u; x = tmp;
	tmp = v; v = y - q * v; y = tmp;
	tmp = b; b = a - q * b; a = tmp;
  }
  x %= (long int)1E9+7;
  while (x<0)
	x+=(long)1E9+7;
  return x;
}
long comb(long n,long k)
{
	long t = 1;
	long j = k;
	for(long i = n; i  >= n-k+1; i--) {
		t *= i;
		t *= extgcd(j);
		j--;
		t %= (long)1E9+7;
	}  
  	while (t<0)
		t+=(long)1E9+7;
	return t;
}
int main()
{
  long long  n, a, b, c, sum, m, l, k, acase, bcase;
  cin >> n >> a >> b;
  c = (long long)pow(2, 30)%(long long)(1E9 + 7);
  m = n/30;
  l = n%30;
  k = (long long)pow(2, l)%(long long)(1E9 + 7);
  
  if(1 <= m){
    sum = c;
    for(int i = 0; i < m - 1; i++){
      sum *= c;
      sum %= (long long)(1E9 + 7);
    }
  }
  sum = (long long)(sum + k - 1)%(long long)(1E9 + 7);
  acase = comb(n, a);
  bcase = comb(n, b);
  sum = sum - acase - bcase;
  sum = sum%(long long)(1E9+7)
  cout << sum <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:31: error: expected ';' before 'cout'
   57 |   sum = sum%(long long)(1E9+7)
      |                               ^
      |                               ;
   58 |   cout << sum <<endl;
      |   ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int conb(int p,int q) {
  //ベースケース
  if(q == 0 || p == q) {
    return 1;
  }
  long long ans = (conb(p-1,q-1) + comb(p-1,q));
  return ans;
}
int main() {
  int n,a,b;
  cin >> n >> a >> b;
  //２のn乗から引く
  int x = 1;
  int y = pow(10,9) + 7;
  for(int i = 1; i <= n; i++) {
    x*=2;
    if(x > y) x -= y;
  }
  x--;
  int z = conb(n,a) + conb(n,b);
  cout << x - z;
}




Compiler output:
a.cc: In function 'int conb(int, int)':
a.cc:8:36: error: 'comb' was not declared in this scope; did you mean 'conb'?
    8 |   long long ans = (conb(p-1,q-1) + comb(p-1,q));
      |                                    ^~~~
      |                                    conb
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
const ll MOD = 1e+9+7;

template< typename T >
T mod_pow(T x, T n, const T &p) {
  T ret = 1;
  while(n > 0) {
    if(n & 1) (ret *= x) %= p;
    (x *= x) %= p;
    n >>= 1;
  }
  return ret;
}

ll n_mod(ll x){
    ll ans=1;
    while(x>0){
        ans*=(x%MOD);
        ans%=MOD;
        x--;
    }
    return ans;
}
int main(){
    ll n,a,b;
    cin >> n >> a >> b;
    ll res ;
    res=mod_pow((ll)2,n,MOD)-1;
    ll nCa=1;
    ll nCb=1;
    vector<int> nCk(2e+5+1);
    nCk[0]=1;
    rep2(i,1,2*e+5+1){
        nCk[i]=((nCk[i-1]*((n-i+1)%MOD))%MOD*mod_pow((ll)i,MOD-2,MOD))%MOD;
    }
    if(res<nCk[a]) res+=MOD;
    res = ( res - nCk[a])%MOD;
    res = ( res - nCk[b])%MOD;

    cout << res << endl;
        
    

   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:16: error: 'e' was not declared in this scope
   37 |     rep2(i,1,2*e+5+1){
      |                ^
a.cc:5:43: note: in definition of macro 'rep2'
    5 | #define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
      |                                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;

vector<long long int> memo(1000000000);

long long pow(long long x, long long n) {
    long long ret = 1;
    while(n > 0) {
        if(n & 1) ret = ret * x % mod;
        x = x * x % mod;
        n >>= 1;
    }

    return ret;
}
long long inv(long long g) {
    long long res = 1;
    for(int i = 0; i < mod - 2; i++) { res = (res * g % mod; }
    return res;
}
long long int C(long long int n1, long long int k1) {
    long long int a1 = 1;
    long long int b1 = 1;
    long long int c1 = 1;
    memo[0] = 1;
   for(long long int i = 1; i <= n1; i++) {
       memo[i] = (memo[i - 1] * i) % mod;
   }

   a1 = memo[n1];
   b1 = memo[n1- k1];
   c1 = memo[k1];
   long long bc = ( b1 * c1 ) % mod;
    long long an = (a1 * inv(bc)) % mod;
    return an;
}

int main() {
    long long int num;
    long long int a,b;
    cin >> num >> a >> b;

    long long int ans = pow(2, num) - 1 - C(num, a) - C(num, b); 
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'long long int inv(long long int)':
a.cc:19:60: error: expected ')' before ';' token
   19 |     for(int i = 0; i < mod - 2; i++) { res = (res * g % mod; }
      |                                              ~             ^
      |                                                            )
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;

vector<long long int> memo(1000000000);

long long pow(long long x, long long n) {
    long long ret = 1;
    while(n > 0) {
        if(n & 1) ret = ret * x % mod;
        x = x * x % mod;
        n >>= 1;
    }

    return ret;
}
long long inv(long long g) {
    long long res = 1;
    for(int i = 0; i < mod - 2; i++) { res = (res * x) % mod; }
    return res;
}
long long int C(long long int n1, long long int k1) {
    long long int a1 = 1;
    long long int b1 = 1;
    long long int c1 = 1;
    memo[0] = 1;
   for(long long int i = 1; i <= n1; i++) {
       memo[i] = (memo[i - 1] * i) % mod;
   }

   a1 = memo[n1];
   b1 = memo[n1- k1];
   c1 = memo[k1];
   long long bc = ( b1 * c1 ) % mod;
    long long an = (a1 * inv(bc) % mod;
    return an;
}

int main() {
    long long int num;
    long long int a,b;
    cin >> num >> a >> b;

    long long int ans = pow(2, num) - 1 - C(num, a) - C(num, b); 
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'long long int inv(long long int)':
a.cc:19:53: error: 'x' was not declared in this scope
   19 |     for(int i = 0; i < mod - 2; i++) { res = (res * x) % mod; }
      |                                                     ^
a.cc: In function 'long long int C(long long int, long long int)':
a.cc:35:39: error: expected ')' before ';' token
   35 |     long long an = (a1 * inv(bc) % mod;
      |                    ~                  ^
      |                                       )