Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
for i in range(n):
    b=a.pop(i)
    print(max(a))
    a.insert(i,b)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
maxa=max(a)
if a.count(maxa)>=2:
    for i in range(n):
        print(maxa)
else:
    maxi=a.index(maxa)
    a.remove(maxa)
    maxa2=max(a)
    for i in range(n):
        if i==maxi:
            print(maxa2)
        else:
            print(maxa)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
minv=200000
for i in range(n):
    a.append(int(input()))
for i in range(n):
    b=a.pop(i)
    print(max(a))
    a.insert(i,b)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
maxa=max(a)
if a.count(maxa)>=2:
    for i in range(n):
        print(maxa)
else:
    maxi=a.index(maxa)
    a.remove(maxa)
    maxa2=max(a)
    for i in range(n):
        if i==maxi:
            print(maxa2)
        else:
            print(maxa)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if dp[2]==0:
    dp[2]=dp[1]+1
else:
    dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if n>1:
    if dp[2]==0:
        dp[2]=dp[1]+1
    else:
        dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if dp[2]==0:
    dp[2]=dp[1]+1
else:
    dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
            continue
print(dp[n]%1000000007)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if n>1:
    if dp[2]==0:
        dp[2]=dp[1]+1
    else:
        dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
ans=0
if n-1 not in a:
    dp[1]=1
if n-2 not in a:
    dp[2]=dp[1]+1
if n>=3:
    for i in range(3,n+1):
        if n-i not in a:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            continue
print(dp[n]%1000000007)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if n>1:
    if dp[2]==0:
        dp[2]=dp[1]+1
    else:
        dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+1)
ans=0
if n-1 not in a:
    dp[1]=1
if n-2 not in a:
    dp[2]=dp[1]+1
for i in range(3,n+1):
    if n-i not in a:
        dp[i]=dp[i-1]+dp[i-2]
    else:
        continue
print(dp[n]%1000000007)

Fixed submission:
n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
dp=[0]*(n+1)
for i in range(m):
    dp[n-a[i]]=-1
if dp[1]==0:
    dp[1]=1
else:
    dp[1]=0
if n>1:
    if dp[2]==0:
        dp[2]=dp[1]+1
    else:
        dp[2]=0
if n>=3:
    for i in range(3,n+1):
        if dp[i]==0:
            dp[i]=dp[i-1]+dp[i-2]
        else:
            dp[i]=0
print(dp[n]%1000000007)
Buggy python submission (verdict: Runtime Error):
s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif a+b==0:
    print('NA')
elif a>12 and b>12:
    print('NA')
elif a==0,b>12:
    print('NA')
elif b==0.a>12:
    print('NA')
elif 0<a<=12 and 12<b:
    print('MMYY')
elif 0<b<=12 and 12<a:
    print('YYMM')
elif 0<a<=12 and 0==b:
    print('MMYY')
elif 0<b<=12 and 1==a:
    print('YYMM')


Fixed submission:
s=list(map(int,input()))
a=10*s[0]+s[1]
b=10*s[2]+s[3]
counta=0
countb=0
'''month'''
if 0<a<=12:
    counta+=1
if 0<b<=12:
    countb+=1
'''year'''
if a==0 or a>=13:
    counta+=5
if b==0 or b>=13:
    countb+=5
j=counta+countb
if j==2:
    print('AMBIGUOUS')
elif j==6 and counta==5:
    print('YYMM')
elif j==6 and countb==5:
    print('MMYY')
else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    pirnt('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')

Fixed submission:
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    print('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')

Buggy python submission (verdict: Runtime Error):
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    pirnt('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')

Fixed submission:
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    print('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')

Buggy python submission (verdict: Runtime Error):
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    pirnt('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')

Fixed submission:
d=int(input())
if d==25:
    print('Christmas')
elif d==24:
    print('Christmas Eve')
elif d==23:
    print('Christmas Eve Eve')
elif d==22:
    print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int, input().split()))
x1 = []
for i, xi in enumerate(x):
    x1.append([i, xi])

x_sort = sorted(x1, key=lambda x: x[1])
t = int(n / 2)
lxt = []
for i in range(n):
    if i < t:
        lxt.append(x_sort[i][0])
    else:
        break

for i in range(n):
    if i in lxt:
        print(x_sort[t][1])
    else:
        print(x_sort[t - 1][1])


Fixed submission:
n = int(input())
x = list(map(int, input().split()))
x1 = []
for i, xi in enumerate(x):
    x1.append([i, xi])

x_sort = sorted(x1, key=lambda x: x[1])
t = int(n / 2)
lxt = []
for i in range(n):
    if i < t:
        x[x_sort[i][0]] = x_sort[t][1]
    else:
        x[x_sort[i][0]] = x_sort[t - 1][1]

for i in range(n):
    print(x[i])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import numpy as np

a = int(input())
result = 0
mat = np.array(list(itertools.product(range(1, a+1), repeat=3)))
result = np.sum(np.gcd(np.gcd(mat[:, 0], mat[:, 1]),mat[:, 2]))

print(result)

Fixed submission:
from functools import reduce
import math

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
result = 0

for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += math.gcd(math.gcd(i, j),k)
      
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
list1 = [np.gcd(np.gcd(x, y),z) for x in range(1, a+1) for y in range(1, a+1) for z in range(1, a+1)]
result = sum(list1)
      
print(result)

Fixed submission:
from functools import reduce
import math

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
result = 0

for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += math.gcd(math.gcd(i, j),k)
      
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from functools import reduce
import math

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
result = 0

for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += math.gcd(math.gcd(i, j),k)
      
print(result)


Fixed submission:
from functools import reduce
import math

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
result = 0

for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += math.gcd(math.gcd(i, j),k)
      
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from functools import reduce
import math

def gcd(*numbers):
    return reduce(math.gcd, numbers)

a = int(input())
result = 0
for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += gcd(i, j, k)
      
print(result)

Fixed submission:
from functools import reduce
import math

#def gcd(*numbers):
#    return reduce(math.gcd, numbers)

a = int(input())
result = 0

for i in range(1, a+1):
  for j in range(1, a+1):
    for k in range(1, a+1):
      result += math.gcd(math.gcd(i, j),k)
      
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split(' '))

balls = []

for i in range(10**100):
  for a in range(A):
    if len(balls) < N:
      balls.append('b') 
    else:
      break

  for b in range(B):
    if len(balls) < N:
      balls.append('r')
    else:
      break
      
  if len(balls) >= N:
    break

print(balls[:N].count('b'))

Fixed submission:
import math
N,A,B=map(int,input().split())
 
d = N//(A+B)*A
d+=min(A,N % (A+B))
 
print (d)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = []
FLAGS = True
for i in range(3):
  N1 = list(map(int, input().split(' ')))
  N.append(N1)

N = np.array(N)

M = int(input())

for i in range(M):
  a = int(input())
  
  for j in range(3):
    for k in range(3):
      if N[j, k] == a:
        N[j, k] = 0
  if (np.all(N == 0, axis = 0).any(0)) or (np.all(N == 0, axis = 1).any(0)) or (np.all(np.diag(N) == 0).any(0)) or (np.all(np.diag(N) == 0).any(0)):
  #if (N[0, :].all() == 0) or (N[1, :].all() == 0) or  (N[2, :].all() == 0) or  (N[:, 0].all() == 0) or (N[:, 1].all() == 0) or (N[:, 2].all() == 0) or (np.diag(N).all() == 0) or (np.diag(np.transpose(N)).all() == 0):
    print('Yes')
    FLAGS = True
    break
  else:
    FLAGS = False
    continue
      
if FLAGS == False:     
  print('No')
                                                                
                       

Fixed submission:
N, M = map(int, input().split(' '))

s_old = []
s_c_old =[]
result = 0
FLAGS = True
for i in range(M):
  s, c = map(int, input().split(' '))

  if (N != 1) & (s == 1) & (c == 0):
    print('-1')
    FLAGS = False
    break
  elif (s in s_old):
    if ([s,c] in s_c_old):
      s_old.append(s)
      s_c_old.append([s,c])
    else:
      print('-1')
      FLAGS = False
      break
  else:
    result += c*10**(N - s)
    s_old.append(s)
    s_c_old.append([s,c])

if (N == 1) and (M == 0):
  result = 0
elif 1 in s_old:
  result = result
#elif N != 1:
else:
  result += 1*10**(N - 1)
  
if FLAGS == True:
  print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
all_list = input().split(' ')

before_list = []

for i in range(N):
  if before_list.count(all_list[i]) == 0:
    before_list.append(all_list[i])
  else:
    print('NO')
    exit()
if len(all_list) == len(before_list):
  print('YES')
  

Fixed submission:
N = int(input())

#listで囲むと良い
A = list(map(int, input().split()))

#setは重複する値が消される
if len(set(A)) == N:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = 1
for i,l in enumerate(li):
    ans *= l
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
if 0 in li:
    print(0)
    exit()

ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        if ans > 10**18:
            print(-1)
            exit()
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        if l == 0:
            print(0)
            exit()
        continue
    else:
        if l == 0:
            print(0)
            exit()
        #print(l,'l')
        ans *= l
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
if 0 in li:
    print(0)
    exit()

ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        if ans > 10**18:
            print(-1)
            exit()
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
li = list(map(int,input().split()))
if 0 in li:
    print(0)
    exit()

ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        if ans > 10**18:
            print(-1)
            exit()
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int,input().split()))
ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
li = list(map(int,input().split()))
if 0 in li:
    print(0)
    exit()

ans = li[0]
for i,l in enumerate(li):
    if i == 0:
        continue
    else:
        #print(l,'l')
        ans *= l
        if ans > 10**18:
            print(-1)
            exit()
        #print(ans)
if ans > 10**18:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
if n%2 ==1:
    for i in range(1,m+1):
        print(i,n-i)
else:
    last = 0
    li = [j for j in range(1,n+1)]
    #print(li)
    for i in range(1,m+1):
        a = min(li)
        b = min(li)+i
        print(a,b)
        li.remove(a)
        li.remove(b)

Fixed submission:
n,m = map(int,input().split())
if n%2 ==1:
    for i in range(1,m+1):
        print(i,n-i)
else:
    left_end = 1+m if m%2 == 1 else m
    left_start = left_end//2
    right_start = left_end+m//2
    for i in range(1,m+1):
        if i%2 == 1:
            print(left_start,left_start+i)
            left_start-=1
        else:
            print(right_start,right_start+i)
            right_start-=1
Buggy python submission (verdict: Runtime Error):
import itertools
s = input()
s_li = list(s)
lee = len(s_li)

count = 0
keta = list(itertools.combinations([i for i in range(lee)], 2))
for k in keta:
    lk = list(k)
    #print(s_li[lk[0]:lk[1]+1])
    if int(''.join(s_li[lk[0]:lk[1]+1]))%2019 == 0:
        count += 1
print(count)

Fixed submission:
s,w = map(int,input().split())
if w>=s:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
li = [i for i in range(0,n+1)]
#print(li)
#[0,1, 2, 3]
tmp = 0
def exc(n):
    return (1+n)*n//2

for i in range(k,n+2):
    #print(i,li[n-i+1:],li[:i],sum(li[n-i+1:]) - sum(li[:i]))
    tmp += sum(li[n-i+1:]) - sum(li[:i]) + 1
print(tmp)

Fixed submission:
n,k = map(int,input().split())
li = [i for i in range(0,n+1)]
#print(li)
#[0,1, 2, 3]
tmp = 0
def exc(n):
    return (n)*(n+1)//2

for i in range(k,n+2):
    #print(i,li[n-i+1:],li[:i],sum(li[n-i+1:]) - sum(li[:i]))
    #tmp += sum(li[n-i+1:]) - sum(li[:i]) + 1
    mi = exc(i-1)
    ma = exc(n) - exc(n-i)
    #print(i,mi,ma,ma - mi + 1)
    tmp += ma - mi + 1
print(tmp%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
s = list(input())
a_li = []
b_li = []
c_li = []
for i,ss in enumerate(s):
    if ss == 'R':
        a_li.append(i)
    elif ss == 'G':
        b_li.append(i)
    else:
        c_li.append(i)
if len(a_li) == 0 or len(b_li)== 0 or len(c_li) == 0:
    print(0)
    sys.exit()
all_count = 0
for a in a_li:
    for b in b_li:
        tmp = len(c_li)
        lili = []
        if (2*b - a)  in c_li:
            lili.append(2*b - a)
        if (2*a - b)  in c_li:
            lili.append(2*a - b)
        if (a + b)% 2 == 0 and (a + b)//2   in c_li:
            lili.append((a + b)//2)
        tmp -= len(set(lili))
        all_count += tmp
print(all_count)

Fixed submission:
n = list(input())
if '7' in n:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
import functools

k = int(input())
li = [i for i in range(1,k+1)]
all_li = list(itertools.product(li, repeat=3))
ans = 0
for a in all_li:
    ans += functools.reduce(math.gcd, a)
print(ans)


Fixed submission:
import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)

Fixed submission:
import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math
import functools

k = int(input())
li = [i for i in range(1,k+1)]
all_li = list(itertools.product(li, repeat=3))
ans = 0
for a in all_li:
    ans += functools.reduce(math.gcd, a)
print(ans)

Fixed submission:
import math
k = int(input())
count = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            tmp = math.gcd(i,j)
            count += math.gcd(tmp,k)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
rev_flag = False
for _ in range(q):
    i = input()
    if i == '1':
        rev_flag = not rev_flag
    else:
        a,b,c = i.split()
        if rev_flag:
            if b == '1':
                s = s + c
            else:
                s = c + s
        else:
            if b == '1':
                s = c + s
            else:
                s = s + c
if rev_flag:
    print(''.join(list(reversed(s))))
else:
    print(s)

Fixed submission:
s = input()
q = int(input())
rev_flag = False
x_lis = []
y_lis = []
for _ in range(q):
    i = input()
    if i == '1':
        rev_flag = not rev_flag
    else:
        a,b,c = i.split()
        if rev_flag:
            if b == '1':
                #s = s + c
                y_lis.append(c)
            else:
                #s = c + s
                x_lis.append(c)
        else:
            if b == '1':
                #s = c + s
                x_lis.append(c)
            else:
                #s = s + c
                y_lis.append(c)
x = ''.join(reversed(x_lis))
y = ''.join(y_lis)
if rev_flag:
    print(''.join(list(reversed(x+s+y))))
else:
    print(x+s+y)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
lis = []
for _ in range(q):
    i = input()
    if i == '1':
        s = ''.join(list(reversed(s)))
    else:
        a,b,c = i.split()
        if b == '1':
            s = c + s
        else:
            s = s + c
print(s)

Fixed submission:
s = input()
q = int(input())
rev_flag = False
x_lis = []
y_lis = []
for _ in range(q):
    i = input()
    if i == '1':
        rev_flag = not rev_flag
    else:
        a,b,c = i.split()
        if rev_flag:
            if b == '1':
                #s = s + c
                y_lis.append(c)
            else:
                #s = c + s
                x_lis.append(c)
        else:
            if b == '1':
                #s = c + s
                x_lis.append(c)
            else:
                #s = s + c
                y_lis.append(c)
x = ''.join(reversed(x_lis))
y = ''.join(y_lis)
if rev_flag:
    print(''.join(list(reversed(x+s+y))))
else:
    print(x+s+y)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,a,b = map(int,input().split())
tmp = 2**n - 1
mn = math.factorial(n)
tmp_a = mn//(math.factorial(n-a)*math.factorial(a))
tmp_b = mn//(math.factorial(n-b)*math.factorial(b))
print((tmp-tmp_a-tmp_b)%(10**9+7))


Fixed submission:
import math
n,a,b = map(int,input().split())
mod = 10**9 + 7
s = pow(2,n,mod) - 1
a_ue = 1
a_shita = 1
b_ue = 1
b_shita = 1
for i in range(1,a+1):
    a_ue = a_ue * (n-i+1) % mod
    a_shita = a_shita * i % mod
a_tmp = a_ue * pow(a_shita,mod-2,mod) % mod
# pow(a_shita,mod-2,mod) で逆元を求める
for j in range(1,b+1):
    b_ue = b_ue * (n-j+1) % mod
    b_shita = b_shita * j % mod
b_tmp = b_ue * pow(b_shita,mod-2,mod) % mod
#print('j',j,b_ue,b_shita,b_ue/b_shita)
print((s-a_tmp-b_tmp)%mod)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
lis = list(map(int,input().split()))
tmp = 0
for i,l in enumerate(lis):
    if i+k <= len(lis)-1:
        #print(i,k)
        if lis[i+k]>l:
            tmp = i+1
#print(tmp)
#print(new_lis)
#print(lis[tmp:tmp+k])
print(sum([(ll+1)/2 for ll in  lis[tmp:tmp+k+1]]))
#print((sum(lis[tmp:tmp+k])+k)/2)

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
if s == u:
    print(a-1,b)
else:
    print(a,b-1)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
lis = list(map(int,input().split()))
new_lis = [(l+1)/2 for l in lis]
ans = 0
for i in range(n-k+1):
    if sum(new_lis[i:i+k]) > ans:
        #print(new_lis[i:i+k])
        ans = sum(new_lis[i:i+k])
print(ans)


Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
if s == u:
    print(a-1,b)
else:
    print(a,b-1)