Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b = map(int,input().split())
if n == 2 :
    print(0)
else:
    ans = 1
    for i in range(n):
        ans = (ans*2)% (10**9+7)
    ans = ans-1
    numa = 1
    for i in range(1,a+1):
        numa = (numa *(n - i + 1) // i)%(10**9+7)
    numb = numa
    for i in range(a+1,b+1):
        numb = (numb * (n - i + 1) //i)%(10**9+7)
    ans = (ans -(numa+numb))%(10**9+7)
    print(ans%(10**9+7))

Fixed submission:
#TRE
#pow(m,n)のnが大きい時は繰り返し2乗法を使う

#繰り返し2乗法のアルゴリズム
def modPow (a,n,p):
    if n==1:
        return a % p
    if n%2 == 1:
        return (a * modPow(a,n-1,p)) % p
    else:
        t = modPow(a,n/2,p)
        return t * t


#main
n,a,b = map(int,input().split())
p = 10**9+7
if n == 2 :
    print(0)
else:
#繰り返し2乗法により計算時間を短縮
    ans = modPow(2,n,p)-1#組み合わせのシグマは2のn乗
#組み合わせはn*...*(n-a+1)/(a*...*1)
    child_a = 1
    mother_a = 1
    for i in range(a):
        child_a = (child_a*(n-i))%p
        mother_a = (mother_a*(i+1))%p
    com_a = (child_a * modPow(mother_a,p-2,p)) % p
    child_b = 1
    mother_b = 1
    for i in range(b):
        child_b = (child_b*(n-i))%p
        mother_b = (mother_b*(i+1))%p
    com_b = (child_b * modPow(mother_b,p-2,p)) % p
    ans = (ans -(com_a+com_b))%p
    print(ans%p)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b = map(int,input().split())
if n == 2 :
    print(0)
else:
    ans = 2**n -1
    numa = 1
    for i in range(1,a+1):
        numa = numa *(n - i + 1) // i
    numb = numa
    for i in range(a+1,b+1):
        numb = numb * (n - i + 1) //i
    ans = ans -(numa+numb)
    print(ans%(10**9+7))

Fixed submission:
#TRE
#pow(m,n)のnが大きい時は繰り返し2乗法を使う

#繰り返し2乗法のアルゴリズム
def modPow (a,n,p):
    if n==1:
        return a % p
    if n%2 == 1:
        return (a * modPow(a,n-1,p)) % p
    else:
        t = modPow(a,n/2,p)
        return t * t


#main
n,a,b = map(int,input().split())
p = 10**9+7
if n == 2 :
    print(0)
else:
#繰り返し2乗法により計算時間を短縮
    ans = modPow(2,n,p)-1#組み合わせのシグマは2のn乗
#組み合わせはn*...*(n-a+1)/(a*...*1)
    child_a = 1
    mother_a = 1
    for i in range(a):
        child_a = (child_a*(n-i))%p
        mother_a = (mother_a*(i+1))%p
    com_a = (child_a * modPow(mother_a,p-2,p)) % p
    child_b = 1
    mother_b = 1
    for i in range(b):
        child_b = (child_b*(n-i))%p
        mother_b = (mother_b*(i+1))%p
    com_b = (child_b * modPow(mother_b,p-2,p)) % p
    ans = (ans -(com_a+com_b))%p
    print(ans%p)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b = map(int,input().split())
sump = 0
for r in range(1,n+1):
    if r ==a or r==b:
        continue
    sump += math.factorial(n) / (math.factorial(n - r) * math.factorial(r))
    if sump >= 10**9+7:
        sump = int(sump) %(10**9+7)
print(round(sump))

Fixed submission:
#TRE
#pow(m,n)のnが大きい時は繰り返し2乗法を使う

#繰り返し2乗法のアルゴリズム
def modPow (a,n,p):
    if n==1:
        return a % p
    if n%2 == 1:
        return (a * modPow(a,n-1,p)) % p
    else:
        t = modPow(a,n/2,p)
        return t * t


#main
n,a,b = map(int,input().split())
p = 10**9+7
if n == 2 :
    print(0)
else:
#繰り返し2乗法により計算時間を短縮
    ans = modPow(2,n,p)-1#組み合わせのシグマは2のn乗
#組み合わせはn*...*(n-a+1)/(a*...*1)
    child_a = 1
    mother_a = 1
    for i in range(a):
        child_a = (child_a*(n-i))%p
        mother_a = (mother_a*(i+1))%p
    com_a = (child_a * modPow(mother_a,p-2,p)) % p
    child_b = 1
    mother_b = 1
    for i in range(b):
        child_b = (child_b*(n-i))%p
        mother_b = (mother_b*(i+1))%p
    com_b = (child_b * modPow(mother_b,p-2,p)) % p
    ans = (ans -(com_a+com_b))%p
    print(ans%p)