Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()

ans = float('inf')
for i in range(N-K+1):
    ans = min(ans,h[i+K-1]-h[i])
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()

ans = 10**9
for i in range(N-K+1,N+1):
    m = min(h[i-K:i])
    M = max(h[i-K:i])
    ans = min(ans,M-m)
print(ans)
Problem p03307 (python)

Fixed submission:
n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2 * n)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
li.sort()
print(abs(li[-1]-li[0]))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
#a*b=gcd(a,b)*lcm(a,b)
lcm = 2*n//math.gcd(2,n)
print(lcm)
Problem p03767 (python)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
ans = sum(a[n::2])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()

#強さを出力
def T(x,y,z):
    ma = max(x,y,z)
    mi = min(x,y,z)
    return (x+y+z) - (ma+mi)

b = a[0::2]
c = a[1::2]


ans = 0
for i in range(0,3*n//2,3):
    #print(b[i:i+3],c[i:i+3])
    ans += T(*b[i:i+3]) + T(*c[i:i+3])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()

#強さを出力
def T(x,y,z):
    ma = max(x,y,z)
    mi = min(x,y,z)
    return (x+y+z) - (ma+mi)

b = a[0::2]
c = a[1::2]


ans = 0
for i in range(0,3*n//2,3):
    print(b[i:i+3],c[i:i+3])
    ans += T(*b[i:i+3]) + T(*c[i:i+3])
print(ans)
Problem p03135 (python)

Fixed submission:
t, x = map(int, input().split())
print(t / x)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(i) for i in input().split()]

if max(l) < sum(l) - max(l) :
    print("Yes")
else:
    print("no")
Problem p02723 (python)

Fixed submission:
# -*- coding: utf-8 -*-
S= list(input())

if S[2]==S[3] and S[4]==S[5]:
    YorN="Yes"
else:
    YorN="No"
print(YorN)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
N,X,Y = map(int,input().split())
ToltN=N*(N-1)/2
Dist=[[0 for i in range(N)] for i in range(N)]
for i in range(N):
    for j in range(i,N):    
        MyDist=abs(i-(X-1))+abs(j-(Y-1))+1
        if MyDist<j-i:
            Dist[i][j]=MyDist
        else:
            Dist[i][j] = j-i
for j in range(N-1):
    ans=[0]
    for i in range(N):
        ans+=Dist[i]
c = collections.Counter(ans)
for i in range(N-1):
    print(c[i+1])
Problem p02831 (python)

Fixed submission:
import fractions
a,b=map(int,input().split())
print((a*b)//(fractions.gcd(a,b)))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print((a*b)//(math.gcd(a,b)))
Problem p03107 (python)

Fixed submission:
S=input()
 
count=0
 
for i in S:
  if i=="1":
    count +=1
 
print(min(count,len(S)-count)*2)

Buggy submission (verdict: Runtime Error):
S=input()

count=0

for i in S:
  if i=="1":
    count +=1

print(min(i,len(S)-count))
Problem p03307 (python)

Fixed submission:
n = int(input())

print(2*n if n%2 else n)

Buggy submission (verdict: Runtime Error):
N = int(input())

print(2*N if N%2==0 else n)
Problem p02726 (python)

Fixed submission:
n,x,y = map(int,input().split())
cnt_l = [0]*n
from collections import deque
# 幅優先探索
def bfs(start):
    queue = deque()
    queue.append(start)
    step_counts = [-1]*(n+1)
    step_counts[start] = 0
    while(queue):
        i = queue.popleft()
        cnt = step_counts[i]
        # 隣のグラフを取得
        if(i==x):
            nex_l = (i-1,y,i+1)
        elif(i==y):
            nex_l = (i-1,x,i+1)
        else:
            nex_l = (i-1,i+1)

        cnt += 1
        for j in nex_l:
            # 端より先だと止める
            if(j < 1 or n < j):
                continue
            # 訪問済みだと止める
            if(step_counts[j]!=-1):
                continue
            queue.append(j)
            step_counts[j] = cnt
            cnt_l[cnt] += 1

for i in range(1,n+1):
    bfs(i)

for i in range(1,n):
    # (a,b),(b,a)のペアがあるため//2
    print(cnt_l[i]//2)

Buggy submission (verdict: Runtime Error):
n,x,y = map(int,input().split())
cnt_l = [0]*n
from collections import deque
# 幅優先探索
def bfs(start):  
  queue = deque()
  queue.append(start)
  step_counts = [-1]*(n+1)
  step_counts[start] = 0
  while(queue):
    i = queue.popleft()
    cnt = step_counts[i]
    # 隣のグラフを取得
    if(i==x):
      nex_l = (i-1,y,i+1)
      elif(i==y):
        nex_l = (i-1,x,i+1)
      else:
        nex_l = (i-1,i+1)

      cnt += 1
      for j in nex_l:
        # 端より先だと止める
        if(j < 1 or n < j):
          continue
          # 訪問済みだと止める
          if(step_counts[j]!=-1):
            continue
            queue.append(j)
            step_counts[j] = cnt
            cnt_l[cnt] += 1


for i in range(1,n+1):
  bfs(i)
 
for i in range(1,n):
  # (a,b),(b,a)のペアがあるため//2
  print(cnt_l[i]//2)
Problem p03804 (python)

Fixed submission:
N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = ''
for _ in range(M):
  B += input()

ans = 'No'
for i in range(N-M+1):
  for j in range(N-M+1):
    sbstr = ''
    for k in range(M):
      sbstr += ''.join(A[i+k][j:j+M]) 
    if B == sbstr:
      ans = 'Yes'

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(input()) for _ in range(N)]
B = ''
for _ in range(M):
  B += input()

ans = 'No'
for i in range(N-M+1):
  for j in range(N-M+1):
    sbstr = ''.join(A[i][j:j+M] + A[i+1][j:j+M])
    if B == sbstr:
      ans = 'Yes'

print(ans)
Problem p02833 (python)

Fixed submission:
import math
N = int(input())
if N % 2 == 1:
    print(0)
else:
    div10 = N // 10
    sum_val = div10
    if sum_val > 0:
        count_5 = math.floor(math.log(div10, 5))
        for i in range(count_5):
            sum_val += div10 // pow(5, i + 1)
    print(sum_val)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
if N % 2 == 1:
    print(0)
else:
    div10 = N // 10
    sum_val = div10
    count_5 = math.floor(math.log(div10, 5))
    for i in range(count_5):
        sum_val += div10 // pow(5, i + 1)
    print(sum_val)
Problem p02847 (python)

Fixed submission:
S = input()

if S == 'SUN':
  print(7)
elif S == 'MON':
  print(6)
elif S == 'TUE':
  print(5)
elif S == 'WED':
  print(4)
elif S == 'THU':
  print(3)
elif S == 'FRI':
  print(2)
elif S == 'SAT':
  print(1)

Buggy submission (verdict: Runtime Error):
S = input()

if S = 'SUN':
  print(7)
elif S = 'MON':
  print(6)
elif S = 'TUE':
  print(5)
elif S = 'WED':
  print(4)
elif S = 'THU':
  print(3)
elif S = 'FRI':
  print(2)
elif S = 'SAT':
  print(1)
Problem p02915 (python)

Fixed submission:
N = int(input())

print(N**3)

Buggy submission (verdict: Runtime Error):
N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N):
    total = total+int(lb[i])+int(lc[i])
#print(total)

k = int(la[N-1])
#print(k)

print(total-int(lc[k-1]))

Buggy submission (verdict: Runtime Error):
N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N):
    total = total+int(lb[i])+int(lc[i])
#print(total)

k = int(la[N-1])
#print(k)

print(total-int(lc[k-1]))

Buggy submission (verdict: Runtime Error):
N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N-1):
    total =total+int(lb[i])+int(lc[i])

print(total-int(lc[int(la[N-1])]))
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
N = int(input())
v = [int(x) for x in input().split()]

v.sort()
#print(v)
for i in range(1,N):
  v[:2] = [(v[0]+v[1])/2]

print(v[0])
Problem p02987 (python)

Fixed submission:
S=list(input())
S.sort()
if (S[0]==S[1])and(S[2]==S[3])and(S[0]!=S[2]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S=input()
S.sort()
if (S[0]==S[1])and(S[2]==S[3])and(S[0]!=S[1]):
  print('Yes')
else:
  print('No')
Problem p02835 (python)

Fixed submission:
a1, a2, a3 = map(int, input().split())
if a1+a2+a3 >= 22:
    print('bust')
else:
    print('win')

Buggy submission (verdict: Runtime Error):
a1, a2, a3 = map(int, input())
if a1+a2+a3 >= 22:
    print('bust')
else:
    print('win')
Problem p02723 (python)

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
if S[2]==S[3] and S[4]==S[5]:
  return "Yes"

return "No"
Problem p02725 (python)

Fixed submission:
# K = int(input())
# N = int(input())
# A = [int(input()) for i in range(N)]
K, N = list(map(int,input().split()))
A = list(map(int,input().split()))
 
D = []
for i in range(N):
	D.append((K + A[i] - A[i - 1]) % K)
    
print(K - max(D))

Buggy submission (verdict: Runtime Error):
K = int(input())
N = int(input())
A = [int(input()) for i in range(N)]

D = []
for i in range(N):
	D.append((K + A[i] - A[i - 1]) % K)
    
print(K - max(D))
Problem p02831 (python)

Fixed submission:
import fractions

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

def lcm(a, b):
    return a * b // fractions.gcd(a, b)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import fractions

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

def lcm(a, b):
    return a * b // fractions.lcm(a, b)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    A, B = list(map(int, input().split()))
    print(np.lcm(A, B))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np

def main():
    row_input = input()
    A, B = list(map(int, input().split()))
    print(np.lcm(A, B))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    row_input = input()
    A = int(row_input.split()[0])
    B = int(row_input.split()[1])
    #A, B = list(map(int, input().split()))
    result = lcm(A, B)
    print(result)

def lcm(x, y):
    return int((x * y) / math.gcd(x, y))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    row_input = input()
    A = int(row_input.split()[0])
    B = int(row_input.split()[1])
    #A, B = list(map(int, input().split()))
    print(lcm(A, B))

def lcm(x, y):
    return int((x * y) / math.gcd(x, y))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

def lcm(x, y):
    return int((x * y) / math.gcd(x, y))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    A, B = map(int, input().split())
    print(lcm(A, B))

def lcm(x, y):
    return int((x * y) / math.gcd(x, y))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    A, B = map(int, input().split())
    print(lcm(A, B))

def lcm(x, y):
    return int((x * y) / math.gcd(x, y))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    A, B = map(int, input().split())
    print(lcm(A, B))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == "__main__":
    main()
Problem p03317 (python)

Fixed submission:
import math
def main():
    line_input = input().split()
    n = int(line_input[0])
    k = int(line_input[1])
    nums = input().split()
    print(math.ceil((n - 1) / (k - 1)))

main()

Buggy submission (verdict: Runtime Error):
N = int(input())
dsum = 0
tmp = N
while tmp > 0:
  dsum += tmp % 10
  tmp /=  10
  tmp  = int(tmp)
if N % dsum != 0:
  print ("No")
else:
  print ("Yes")
Problem p02723 (python)

Fixed submission:
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")

Buggy submission (verdict: Runtime Error):
S = input()
print("Yes" if S[2] == S[3] and S[4] == S[5])
Problem p03208 (python)

Fixed submission:
N, K = list(map(int, input().split()))
# print(N)
# print(K)
h_list = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_list[i] = x
    x = 0
j = 0
min = 1000000000
for i in range(100000 - N):
    h_list.remove(0)
# print(h_list)
h_list.sort()
# print(h_list)
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K-1] - h_list[q]
#    print(q)
#    print(h_list[q+K-1], h_list[q])
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
h_l = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_l[i] = x
    x = 0
j = 0
min = 1000000000
h_list = [j for j in h_l if h_l[j] == 0]
h_list.sort()
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K - 1] - h_list[q]
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
# print(N)
# print(K)
h_l = [0]*100000
i = 0
for i in range(N):
    x = int(input())
    h_l[i] = x
    x = 0
j = 0
min = 1000000000
h_list = [j for j in h_l if h_l[j] == 0]
h_list.sort()
# print(h_list)
y = 0
q = 0
while q < N-K+1:
    y = h_list[q + K - 1] - h_list[q]
#    print(q)
#    print(h_list[q+K-1], h_list[q])
    if y < min:
        min = y
        y = 0
    else:
        y = 0
    q += 1
print(min)
Problem p02723 (python)

Fixed submission:
S= list(input())
 
if S[2]==S[3]:
    if S[4] == S[5]:
        print('Yes')
    else:
        print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = list(input())

if S[2]==S[3]:
	if S[4] == S[5]:
    	print('Yes')
	else:
      print('No')
else:
  print('No')
Problem p02725 (python)

Fixed submission:
K,N = map(int,input().split())
A = list(map(int,input().split()))
L = []
T = K+A[0]-A[-1]
for i in range(N-1):
  L.append(A[i+1]-A[i])
L.append(T)
print(K-max(L))

Buggy submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = list(map(int,input()))
L = []
T = K+A[0]-A[-1]
for i in range(N-1):
  L.append(A[i+1]-A[i])
print(K-max(L))

Buggy submission (verdict: Runtime Error):
K,N = map(int,input().split())
A = list(map(int,input()))
L = 0
for i in range(0,N-1):
    if A[i+1]-A[i] >L:
        L = A[i+1]-A[i]
print(K-L)
Problem p02723 (python)

Fixed submission:
str = input()

if str[2] == str[3] and str[4] == str[5]:
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
str = input()

str[2] == str[3] and str[4] == str[5] ? 'Yes' : 'No'

Buggy submission (verdict: Runtime Error):
str = input()

str[2] == str[3] and str[4] == str[5] ? 'Yes' : 'No';

Buggy submission (verdict: Runtime Error):
str = input()

str[2] == str[3] && str[4] == str[5] ? 'Yes' : 'No';
Problem p02836 (python)

Fixed submission:
s = input()
n = len(s)
count = 0
for i in range(n//2):
  if s[i] != s[n - 1 - i]:
    count += 1 
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<=j:
  	if a[i] != a[j-i-1]:
    	count += 1 
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if i<j:
  	if a[i] != a[j-i-1]:
    	count += 1 
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
a = s.split()
count = 0
j = len(s)
for i in range(j):
  if a[i] != a[j-i-1]:
    count += 1 
print(count)
Problem p02729 (python)

Fixed submission:
N,M=map(int,input().split())
t =0
if N>=2:
	t+=N*(N-1)//2
if M>=2:
    t+=M*(M-1)//2
print(t)

Buggy submission (verdict: Runtime Error):
N,M=map(int(input().split())
total=0
if N>=2
	total+=N*(N-1)/2
if M>=2
    total+=M*(M-1)/2
print(total)
Problem p02723 (python)

Fixed submission:
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No')
Problem p02725 (python)

Fixed submission:
k,n = map(int, input().split())
a = list(map(int, input().split()))
max_dis = 0
for i in range(n):
    if i == n-1:
        max_dis = max(max_dis,a[0]+k-a[i])
    else:
        max_dis = max(max_dis,a[i+1]-a[i])
print(k-max_dis)

Buggy submission (verdict: Runtime Error):
f=list(map(int,input().split()))
k=f[0];n=f[1]
dists=list(map(int,input().split()))
prev=0
maxdist=0
for d in range(1,len(dists)):
  maxdist=max(maxdist,abs(prev-dists[d]))
  prev=dists[d]
a=max(maxdist,maxdist-dists[len(dists)]+dists[0])  
ans=k-a
print(ans)
Problem p02771 (python)

Fixed submission:
W= [int(x) for x in input().split()]
print("Yes" if len(set(W)) ==2 else "No")

Buggy submission (verdict: Runtime Error):
W= [int(x) for x in input().split()]
print("Yes" if len(set(W) ==2 else "No")
Problem p02790 (python)

Fixed submission:
N,S = [int(x) for x in input().split()]
a=max(N,S)
b=min(N,S)
c=0
for i in range(a): c+=b*10**i
print(c)

Buggy submission (verdict: Runtime Error):
N,S = [int(x) for x in input().split()]
a=max(N,S)
b=min(N,S)
c=0
for i in range(min): c+=a*10**i
print(c)
Problem p02819 (python)

Fixed submission:
import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:
                K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2

Buggy submission (verdict: Runtime Error):
import math
K = int(input())
if K==2: print(K)
else:
        if K%2 ==0:K+=1
                while True:
                        flg =0
                        N = int(math.sqrt(K))
        
                        for i in range(2,N):
                                if K%i == 0:
                        
                                        flg = 1
                                        break
                        if flg == 0:
                                print(K)
                                break
                        K+=2

Buggy submission (verdict: Runtime Error):
import math
K = int(input())
if K==2: print(K)
else:
if K%2 ==0:K+=1
        while True:
                flg =0
                N = int(math.sqrt(K))
        
                for i in range(2,N):
                        if K%i == 0:
                        
                                flg = 1
                                break
                if flg == 0:
                        print(K)
                        break
                K+=2
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    n=int(N/2)
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
  	n=int(N/2)
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
  	n=N//2
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    S = input()
    if S[:n]==S[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2 == 1: print("No")
else:
    S = input()
    if S[:n]==s[n:] :print("Yes")
    else:print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 1: print("No")
elif S[:N/2] == S[N/2:]:print("Yes")
else: print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 1: print("No")
elif S[:N/2] == S[N/2:] print("Yes")
else: print("No")
Problem p02862 (python)

Fixed submission:
def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)

# ax ≡ 1 (mod m)

def modinv(a, m):
    (inv, q, gcd_val) = egcd(a, m)
    #print(inv, q, gcd_val)
    return inv % m

def m(n,r):
    d=1
    e=1
    f=1
    for i in range(r):
        d=(n-i)
        e=(i+1)
        d%=(10**9+7)
        f = f*d*modinv(e,(10**9+7))%(10**9+7)
        
    return(f)

n=[int(i) for i in input().split()]
a=sum(n)
if a%3 != 0:print(0)

else:
    b=int(a/3)
    if b==1:
        print(1)
    else:
        c=n[0]-b
        d=n[1]-b
        if c<0 or d<0: print(0)

        else:
            if c==d:
                c=int(b/2)
            d=m(b,min(c,d))
            print(d%(10**9+7))

Buggy submission (verdict: Runtime Error):
def m(n,r):
    d=1
    c=1
    for i in range(r):
        d*=(n-i)
        c*=(i+1)
    return(int(d/c))

n=[int(i) for i in input().split()]
a=sum(n)
c=max(n)-min(n)
if a%3 != 0:print(0)
elif c!=0 and a/c < 0.5:print(0)
else:
    b=int(a/3)
    if b==1:
        print(1)
    else:
        if c==0:
            c=int(b/2)
        d=m(b,c)
        print(d%(10**9+7))

Buggy submission (verdict: Runtime Error):
def m(n,r):
    d=1
    c=1
    for i in range(r):
        d*=(n-i)
        c*=(i+1)
    return(int(d/c))

N,Y= [int(i) for i in input().split()]
a=N+Y
if a%3 != 0:print(0)
else:
    b=int(a/3)
    c=abs(N-Y)
    if b==1:
        print(1)
    else:
        if c==0:
            c=int(b/2)
        d=m(b,c)
        print(d%(10**9+7))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

N,Y= [int(i) for i in input().split()]
a=N+Y
if a%3 != 0:print(0)
else:
    b=int(a/3)
    c=abs(N-Y)
    if b==1:
        print(1)
    elif c==0:
        e=int(b/2)
        print(int(comb(b,e,exact=True))%(10**9+7))
    else:
        print(int(comb(b,c,exact=True))%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
N,Y= [int(i) for i in input().split()]
a=N+Y
if a%3 != 0:print(0)
else:
    b=a/3
    print(int((math.factorial(b)/math.factorial(abs(N-Y)))%(10**9+7)))
Problem p03012 (python)

Fixed submission:
N = int(input())
n = list(map(int, input().split()))
sm=sum(n)
av = sm/2
c =0

for i in range(N):
	c += n[i]
	if c == av:
		print(0)
		exit()
	elif c > av:
		b1 = abs(c - (sm-c))
		b2 = abs((c-n[i]) - (sm-c+n[i]))
		print(b1 if b1<b2 else b2)
		exit()

Buggy submission (verdict: Runtime Error):
sm=sum(n)
av = sm/2
c =0

for i in range(len(n)):
	c += n[i]
	if c == av:
		print(0)
		exit()
	elif c > av:
		b1 = abs(c - (sm-c))
		b2 = abs((c-n[i]) - (sm-c+n[i]))
		print(b1 if b1<b2 else b2)
		exit()
Problem p02723 (python)

Fixed submission:
s=input()
if (s[2]==s[3] and s[4]==s[5]):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n, x, y = map(int, input().split())
li = [0] * (n-1)
for i in range(1, n+1):
  for j in range(i+1, n+1):
    num = min(j-i, abs(x-i)+abs(y-j)+1)
    li[num-1] += 1
for i in range(n-1):
  print(li[i])
Problem p02753 (python)

Fixed submission:
s = input()
if (s[0] != s[1] or s[0] != s[2]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if s = AAA and s = BBB :
    print('No')
else:
    print('Yes')
Problem p02754 (python)

Fixed submission:
n,a,b=map(int,input().split())
print((n//(a+b))*a+min(a,n%(a+b)))

Buggy submission (verdict: Runtime Error):
balls=map(int,input().split())
print((n//(a+b))*a+min(a,n%(a+b)))
Problem p02835 (python)

Fixed submission:
input_line = input()
v1,v2,v3 = input_line.split(' ')
total = int(v1)+int(v2)+int(v3)
if total >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
input_line = input()
v1,v2,v3 = input_line.split(' ')
if v1+v2+v3 >= 22:
  print('bust')
else:
  print('win')