Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

import math
def cmb(n, a, p):
    ans = 1
    for i in range(a):
        ans *= (n-i)
    return (ans // math.factorial(a)) % p
    
n,a,b = map(int,input().split())
mod = 10**9 + 7
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod
print((pow(n,2,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)


Fixed submission:
#!/usr/bin/env python3
def fac(n,a):
  ans = 1
  for i in range(n,n-a,-1):
    ans *= i
    ans %= mod
  return ans
def cmb(n, a, mod):
    ans = fac(n,a)
    inv = fac(a,a-1)
    return (ans*pow(inv,mod-2,mod)) % mod

n,a,b = map(int,input().split())
mod = 10**9 + 7
#他人のコードパクったけど高速化の理由不明
"""
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod"""
print((pow(2,n,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def cmb(n,r):
    ans = 1
    for i in range(r):
      ans *= n-i
    for i in range(1,r+1):
      ans //= i
    return ans
n,a,b = map(int,input().split())
mod = 10**9 + 7
def exp_2(n):
  if n == 0: return 1
  if n % 2: return 2 * exp_2(n//2)**2
  else: return exp_2(n//2)**2
print((exp_2(n) - 1 - cmb(n,a) - cmb(n,b))%mod)


Fixed submission:
#!/usr/bin/env python3
def fac(n,a):
  ans = 1
  for i in range(n,n-a,-1):
    ans *= i
    ans %= mod
  return ans
def cmb(n, a, mod):
    ans = fac(n,a)
    inv = fac(a,a-1)
    return (ans*pow(inv,mod-2,mod)) % mod

n,a,b = map(int,input().split())
mod = 10**9 + 7
#他人のコードパクったけど高速化の理由不明
"""
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod"""
print((pow(2,n,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import math
#あらかじめmax(a,b)までinv　を計算する
n,a,b = map(int,input().split())
P = 10**9 + 7
N = max(a,b)+1
inv_t = [0]+[1]
for i in range(2,N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]
def cmb(n, a, p):
    ans = 1
    for i in range(a):
        ans *= (n-i) * inv_t[i+1] % p
    return ans
#print(cmb(n,a,p),cmb(n,b,p))
print((2**n - 1 - cmb(n,a,P) - cmb(n,b,P))%P)

Fixed submission:
#!/usr/bin/env python3
def fac(n,a):
  ans = 1
  for i in range(n,n-a,-1):
    ans *= i
    ans %= mod
  return ans
def cmb(n, a, mod):
    ans = fac(n,a)
    inv = fac(a,a-1)
    return (ans*pow(inv,mod-2,mod)) % mod

n,a,b = map(int,input().split())
mod = 10**9 + 7
#他人のコードパクったけど高速化の理由不明
"""
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod"""
print((pow(2,n,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import math
def cmb(n, a, p):
    ans = 1
    for i in range(a):
        ans *= (n-i)
    return (ans // math.factorial(a)) % p

p = 10 ** 9 + 7
n,a,b = map(int,input().split())
#print(cmb(n,a,p),cmb(n,b,p))
print((2**n - 1 - cmb(n,a,p) - cmb(n,b,p))%p)

Fixed submission:
#!/usr/bin/env python3
def fac(n,a):
  ans = 1
  for i in range(n,n-a,-1):
    ans *= i
    ans %= mod
  return ans
def cmb(n, a, mod):
    ans = fac(n,a)
    inv = fac(a,a-1)
    return (ans*pow(inv,mod-2,mod)) % mod

n,a,b = map(int,input().split())
mod = 10**9 + 7
#他人のコードパクったけど高速化の理由不明
"""
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod"""
print((pow(2,n,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
n,a,b = map(int,input().split())
mod = 10**9 + 7
print((2**n - 1 - cmb(n,a) - cmb(n,b))%mod)

Fixed submission:
#!/usr/bin/env python3
def fac(n,a):
  ans = 1
  for i in range(n,n-a,-1):
    ans *= i
    ans %= mod
  return ans
def cmb(n, a, mod):
    ans = fac(n,a)
    inv = fac(a,a-1)
    return (ans*pow(inv,mod-2,mod)) % mod

n,a,b = map(int,input().split())
mod = 10**9 + 7
#他人のコードパクったけど高速化の理由不明
"""
def pow(n,b,mod):
  if n == 0: return 1
  if n % 2: return 2 * pow(n//2,b,mod)**2 % mod
  else: return pow(n//2,b,mod)**2 % mod"""
print((pow(2,n,mod) - 1 - cmb(n,a,mod) - cmb(n,b,mod))%mod)