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

Fixed submission:
print((input().count("o"))*100+700)

Buggy submission (verdict: Runtime Error):
List = list(int,input().split())
price = 700 + List.count('○')
print(price)

Buggy submission (verdict: Runtime Error):
List = list(map(int,input().split()))
price = 700 + List.count('○')
print(price)

Buggy submission (verdict: Runtime Error):
S = list(map(int,input().split()))
price = 700 + list.count('○')
print(price)
Problem p03370 (python)

Fixed submission:
N,X=map(int,input().split())
weight = [int(input()) for weight in range(N)]
W = sum(weight)
P =(X- W) // min(weight)
print(N+P)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
weight = []
W = sum(weight)
P =(X- W) // weight.min()
print(N+P)
Problem p03420 (python)

Fixed submission:
N,K=map(int,input().split())
def f(b):
  d=max(b-K,0)*(N//b)+max(N%b-K+1,0)
  return d
ans=0
if K==0:
  print(N**2)
  exit()
  
for i in range(1,N+1):
  ans+=(f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
,K=map(int,input().split())
def f(b):
  d=max(b-K,0)*(N//b)+max(N%b-K+1,0)
  return d
ans=0
if K==0:
  print(N**2)
  exit()
  
for i in range(1,N+1):
  ans+=(f(i))
print(ans)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input(),split())
if (a*b) % 2 == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a , b = map(int,input(),split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a , b = map(int,input(),split())
if (a*b)% == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a,b = map(int,input(),split())
if a*b% == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
map(int,input(),split())
if a*b% == 1:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
numa = int(a)
numb = int(b)
num = numa * numb
if num % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
num = int(a)*int(b)
if num % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
num = a*b
if num % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
num = a*b
if num % 2 == 0:
    print "Even"
else:
    print "Odd"

Buggy submission (verdict: Runtime Error):
mod = ( a * b )%2

if mod == 0:
  print'Even'
else:
  print'Odd'

Buggy submission (verdict: Runtime Error):
c = a*b
if c%2 = 1:
  print('odd')
else:
  print('even')

Buggy submission (verdict: Runtime Error):
if (a*b)//2 == 1:
  print('odd')
else:
  print('even')

Buggy submission (verdict: Runtime Error):
if a * b //2 == 1:
  print('odd')
else:
  print('even')
Problem p03469 (python)

Fixed submission:
S = input()
print('2018'+S[4:])

Buggy submission (verdict: Runtime Error):
S = input()
print('2018'+s[4:])
Problem p03471 (python)

Fixed submission:
N,Y=map(int,input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            print(x,y,z)
            exit()
print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
N,Y=map(int,input().split())
for x in range(N+1):
  for y in range(N+1-x):
    z=N-x-y
    if 10000*x+5000*y+1000*z == Y and 2000=>z=>0:
      print((x,y,z))
      exit()
      
print(-1,-1,-1)
Problem p03477 (python)

Fixed submission:
A,B,C,D=map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')

Buggy submission (verdict: Runtime Error):
A,B,C,D=map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B>C+D::
  print('Right')
else:
  print('Balanced')
Problem p03495 (python)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
U=len(set(A))

import collections

if U > K:
  c = collections.Counter(A)
  d = c.most_common(K)
  print(N-(sum(x[1] for x in d)))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
U=len(set(A))

S=[]
for i in range(1,N+1):
  S.append(A.count(i))

T=sorted(S)[::-1]

if U > K:
  ans = 0
  for j in range(0,K):
    ans+= T[j]
print(N-ans)

if U <= K:
  print(0)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
U=len(set(A))

S=[]
for i in range(1,N+1):
  S.append(A.count(i))

T=sorted(S)[::-1]

if U > K:
  ans = 0
  for j in range(0,K):
    ans+= T[j]
print(N-ans)

if U <= K:
  print(0)
Problem p03501 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split)
print(min(n*a,b))
Problem p03552 (python)

Fixed submission:
N,Z,W=map(int,input().split())
A=list(map(int, input().split()))
if N==1:
  print(abs(A[-1]-W))
else:
  a=abs(A[-1]-W)
  b=abs(A[-2]-A[-1])
  print(max(a,b))

Buggy submission (verdict: Runtime Error):
A=list(map(int, input().split()))
if N==1:
  print(abs(A[-1]-W))
else:
  a=abs(A[-1]-W)
  b=abs(A[-2]-A[-1])
  print(max(a,b))

Buggy submission (verdict: Runtime Error):
N,Z,W=map(int,input().split())
A=list(map(int, input().split()))
if N==1:
  print(abs(A[-1]-W))
elif N==2:
  print(abs(A[-1]-W),abs(A[0]-A[-1]))
else:
  a=abs(A[-1]-W)
  b=abs(max(A[:N-1])-A[-1])
  print(max(a,b)
Problem p03578 (python)

Fixed submission:
N=int(input())
D=list(map(int, input().split()))
M=int(input())
T=list(map(int, input().split()))
if N<M:
  print('NO')
  exit()
  
A={}
B={}
for i in D:
  if i not in A:
    A[i]=0
  A[i]+=1
  
for i in T:
  if i not in B:
    B[i]=0
  B[i]+=1
  
for i in B.keys():
  if not i in A:
    print('NO')
    exit()
  if A[i]<B[i]:
    print('NO')
    exit()
print('YES')

Buggy submission (verdict: Runtime Error):
N=int(input())
D=list(map(int, input().split()))
M=int(input())
T=list(map(int, input().split()))
if N<M:
  print('NO')
  exit()
A={}
B={}
for i in D:
  if i not in A:
    A[i]=0
  A[i]+=1
  
for i in T:
  if i not in B:
    B[i]=0
  B[i]+=1
  
for i in B.keys():
  if not A[i]:
    print('NO')
    exit()
  if A[i]<B[i]:
    print('NO')
    exit()
print('YES')
Problem p03583 (python)

Fixed submission:
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j!=0:
        w=(N*i*j)/(4*i*j-N*i-N*j)
        if w>0 and w.is_integer():
          print(i,j,int(w))
          exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j>0:
        if (N*i*j/(4*i*j-N*i-N*j)).is_integer():
          print(i,j,int(w))
          exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j>0:
        if N*i*j/(4*i*j-N*i-N*j).is_integer():
          print(i,j,int(w))
          exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      if 4*i*j-N*i-N*j>0 and (N*i*j)/(4*i*j-N*i-N*j).is_integer():
          print(i,j,int(w))
          exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    w=(N*i*j)/(4*i*j-N*i-N*j)
    if w>0 and w.is_integer():
      print(i,j,int(w))
      exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      w=(N*i*j)/(4*i*j-N*i-N*j)
      if w>0 and w.is_integer():
        print(i,j,int(w))
        exit()

Buggy submission (verdict: Runtime Error):
N=int(input())
if N%2==0:
  print(N//2,N,N)
else:
  for i in range(1,3501):
    for j in range(1,3501):
      w=(N*i*j)/(4*i*j-N*i-N*j)
      if w>0 and w.is_integer():
        print(i,j,int(w))
        exit()
Problem p03597 (python)

Fixed submission:
a=int(input())
b=int(input())
print(a*a-b)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split(' '))
maxconc = 0.0
maxwater = 100*A
maxsugar = 0

for i in range(F//(100*A)+1):
  for j in range((F-100*A*i)//(100*B)+1):
    if i == 0 and j == 0:
      continue
    S =min(E*(A*i+B*j),F-100*(A*i+B*j))
    
    sugar=0
    for c in range(S//C+1):
      d = (S-c*C)//D
      sugar = max(sugar,c*C+d*D)
    conc = sugar / (sugar +100*(A*i+B*j))
    if conc > maxconc:
      maxconc = conc 
      maxwater = 100*(A*i+B*j)
      maxsugar = sugar
print('{0} {1}'.format(maxwater+maxsugar,maxsugar))

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split(' '))

max_sugar = 0
max_water = 100*A
max_conc = 0.0
A_limit = F // (100*A)
for i in range(A_limit + 1):
    B_limit = (F-100*A*i) // (100*B)
    for j in range(B_limit + 1):
        if i == 0 and j == 0:
            continue
        sugar_limit = min(E * (A*i+B*j), F-100*(A*i+B*j))

        sugar_ = 0
        for c in range(sugar_limit//C + 1):
            d = (sugar_limit-c*C)//D
            temp_sugar = c*C + d*D
            sugar_ = max(sugar_, temp_sugar)
        temp_conc = sugar_/(sugar_+100*(A*i+B*j))
        if temp_conc > max_conc:
            max_conc = temp_conc
            max_water = 100*(A*i + B*j)
            max_sugar = sugar_
print('{0} {1}'.format(max_water+max_sugar, max_sugar))
Problem p03610 (python)

Fixed submission:
L = input()
print(L[::2])

Buggy submission (verdict: Runtime Error):
L = index()
print(L[::2])
Problem p03612 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N-1):
  if i+1==A[i]:
    a=A[i]
    b=A[i+1]
    A[i]=b
    A[i+1]=a
    cnt+=1
if A[-1]==N:
  cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N):
  if i+1==A[i]:
    a=A[i]
    b=A[i+1]
    A[i]=b
    A[i+1]=a
    cnt+=1
print(cnt)
Problem p03636 (python)

Fixed submission:
s = input()
print( s[0] + str(len(s)-2) + s[-1] )

Buggy submission (verdict: Runtime Error):
s = input()
print( s[:2] + str(len(s)-2) + s[len(s-1):] )

Buggy submission (verdict: Runtime Error):
S = input()
L = len(s)
print( S[:2]+str(L-2) +S[(L-1):] )
Problem p03643 (python)

Fixed submission:
N=int(input())
print('ABC',N,sep='')

Buggy submission (verdict: Runtime Error):
N=int(input())
print('ABC'+N)
Problem p03644 (python)

Fixed submission:
a = int(input())
n = 0
while 2**n <= a:
  n += 1
print(2**(n-1))

Buggy submission (verdict: Runtime Error):
n = 0
while 2**n <= (int(input())):
  n += 1
print(2**(n-1))

Buggy submission (verdict: Runtime Error):
n = 0
while 2**n <= int(input()):
  n += 1
print(2**(n-1))
Problem p03676 (python)

Fixed submission:
n=int(input())
A=list(map(int, input().split()))
B=sorted(A)
for i in range(n+1):
  if B[i]!=i+1:
    a=i
    break
d=[i for i, x in enumerate(A) if x==a]
x=d[0]
y=d[1]

def cmb(n,r,mod):
    if (r<0 or r>n):
      return 0
    r=min(r,n-r)
    return g1[n]*g2[r]*g2[n-r]%mod

mod=10**9+7 #出力の制限
N=10**5+10
g1=[1,1] # 元テーブル
g2=[1,1] #逆元テーブル
inverse=[0,1] #逆元テーブル計算用テーブル

for i in range(2,N+1):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

for i in range(1,n+2):
  ans=cmb(n+1,i,mod)-cmb(x+(n-y),i-1,mod)
  if ans<0:
    print(mod+ans)
  else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int, input().split()))
B=sorted(A)
for i in range(n+1):
  if B[i]!=i+1:
    a=i
    break
d=[i for i, x in enumerate(A) if x==a]
x=d[0]
y=d[1]

def cmb(n,r,mod):
    if (r<0 or r>n):
      return 0
    r=min(r,n-r)
    return g1[n]*g2[r]*g2[n-r]%mod

mod=10**9+7 #出力の制限
N=10**5
g1=[1,1] # 元テーブル
g2=[1,1] #逆元テーブル
inverse=[0,1] #逆元テーブル計算用テーブル

for i in range(2,N+1):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

for i in range(1,n+2):
  print(cmb(n+1,i,mod)-cmb(x+(n-y),i-1,mod))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int, input().split()))
B=sorted(A)
for i in range(n+1):
  if B[i]!=i+1:
    a=i
    break
d=[i for i, x in enumerate(A) if x==a]
x=d[0]
y=d[1]

def cmb(n,r,mod):
    if (r<0 or r>n):
      return 0
    r=min(r,n-r)
    return g1[n]*g2[r]*g2[n-r]%mod

mod=10**9+7 #出力の制限
N=10**4
g1=[1,1] # 元テーブル
g2=[1,1] #逆元テーブル
inverse=[0,1] #逆元テーブル計算用テーブル

for i in range(2,N+1):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

for i in range(1,n+2):
  print(cmb(n+1,i,mod)-cmb(x+(n-y),i-1,mod))
Problem p03814 (python)

Fixed submission:
s = input()

CA = s.index('A')
CZ = s.rindex('Z') 


print(CZ-CA+1)

Buggy submission (verdict: Runtime Error):
s = input()
A= s.index('A')
for r in s[::-1]:
    Z = r.index('Z') 
print(s-Amin-Zmax+2)

Buggy submission (verdict: Runtime Error):
s = input()
Amin = s.index('A')
for r in s[::-1]:
Zmax = r.index('Z') 
print(s-Amin-Zmax+2)
Problem p03910 (python)

Fixed submission:
N=int(input())
a=1
cnt=1
while cnt<=N:
  a+=1
  cnt+=a
for i in range(a):
  if i+1!=cnt-N:
    print(i+1)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=1
while N-a>=a:
    print(a)
    b=N-a
    N-=a
    a+=1 
print(b)
Problem p03285 (python)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    for x in range(0, 100):
        y = N - 4 * x
        if y < 0:
            break
        if y % 7 == 0:
            print ("Yes")
            exit(0)
    print ("No")

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = input()
    for x in range(0, 100):
        y = N - 4 * x
        if y % 7 == 0:
            print ("Yes")
            exit(0)
    print ("No")
Problem p03606 (python)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    res = 0
    for x in range(N):
        a,b = map(int, input().split())
        res += b - a + 1
    print (res)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    N = input()
    res = 0
    for x in range(N):
        a,b = map(int, input().split())
        res += b - a + 1
    print (res)
Problem p03648 (python)

Fixed submission:
if __name__ == "__main__":
    K = int(input())
    N = 50
    result = list(range(N))
    for x in range(N):
        result[x] += K // N
    K %= N

    for x in range(K):
        result[x] += N + 1
        for i in range(N):
            result[i] -= 1
    print (len(result))
    print (" ".join(map(str, result)))

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    K = int(input())
    if (K == 0):
        print (2)
        print (0, 0)
        exit()
    if (K == 1):
        print (2)
        print (2, 0)

    if (K <= 50):
        print (K)
        res = []
        for x in range(K):
            res.append(x + 1)
        print (" ".join(map(str, res)))
        exit()
    assert(False)

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    K = int(input())
    if (K == 0):
        print (1)
        print (0)
        exit()
    if (K <= 50):
        print (K)
        res = []
        for x in range(K):
            res.append(x + 1)
        print (" ".join(map(str, res)))
        exit()
    if (K <= 10 ** 16 + 1000):
        print (1)
        print (K)
        exit()
    assert(False)
Problem p03688 (python)

Fixed submission:
import sys
if __name__ == "__main__":
    N = int(input())
    evidences = list(map(int, input().split()))
    evidences = list(sorted(evidences))
    unique_evidence = set(evidences)
    if (evidences[-1] - evidences[0] > 1):
        print ("No")
        sys.exit()
    if (len(unique_evidence) == 1):
        group = evidences[0];
        # all unique
        if (group == N - 1):
            print ("Yes")
            sys.exit()
        if (N - 2 * group < 0):
            print ("No")
            sys.exit()
        print ("Yes")
        sys.exit()
    # evidences[-1] - evidences[0] > 1
    min_val = min(evidences)
    max_val = max(evidences)

    min_val_cnt = 0
    max_val_cnt = 0
    for val in evidences:
        if (val == min_val):
            min_val_cnt += 1
        else:
            max_val_cnt += 1
    # violate not unique
    if (max_val_cnt <= 1):
        print ("No")
        sys.exit()
    #rest cat
    rest = N
    rest -= min_val_cnt

    min_group = min_val_cnt + 1
    max_group = min_val_cnt + (max_val_cnt // 2)
    if min_group <= evidences[-1] and evidences[-1] <= max_group:
        print ("Yes")
        sys.exit()
    print ("No")

Buggy submission (verdict: Runtime Error):
import sys
if __name__ == "__main__":
    N = int(input())
    evidences = list(map(int, input().split()))
    evidences = list(sorted(evidences))
    unique_evidence = set(evidences)
    if (evidences[-1] - evidences[0] > 1):
        print ("No")
        sys.exit()
    if (len(unique_evidence) == 1):
        group = evidences[0];
        # all unique
        if (group == N - 1):
            print ("Yes")
            sys.exit()
        if (N - 2 * group < 0):
            print ("No")
            sys.exit()
        print ("Yes")
        sys.exit()
    # evidences[-1] - evidences[0] > 1
    min_val = min(evidences)
    max_val = max(evidences)

    min_val_cnt = 0
    max_val_cnt = 0
    for val in evidences:
        if (val == min_val):
            min_val_cnt += 1
        else:
            max_val_cnt += 1
    # violate not unique
    if (max_val_cnt <= 1):
        print ("No")
        sys.exit()
    #rest cat
    rest = N
    rest -= min_val_cnt

    min_group = min_val_cnt + 1
    max_group = min_val_cnt + (max_val_cnt // 2)
    if min_group <= evidences[-1] and evidences <= max_group:
        print ("Yes")
        sys.exit()
    print ("No")
Problem p03844 (python)

Fixed submission:
if __name__ == "__main__":
    a,b,c = input().split()
    if (b == '+'):
        print (int(a) + int(c))
    else:
        print (int(a) - int(c))

Buggy submission (verdict: Runtime Error):
if __name__ == "__main__":
    a,b,c = input().split()
    if (b == '+'):
        print (int(a) + int(b))
    else:
        print (int(a) - int(b))
Problem p03845 (python)

Fixed submission:
if __name__ == "__main__":
    N = int(input())
    T = list(map(int, input().split()))
    M = int(input())
    data = []
    for x in range(M):
        p,x = map(int, input().split())
        p -= 1
        data.append([p, x])
    result = 2 ** 60
    for p,x in data:
        res = 0
        for i,t in enumerate(T):
            if (i == p):
                res += x
            else:
                res += t
        print (res)

Buggy submission (verdict: Runtime Error):

    N = int(input())
    T = list(map(int, input().split()))
    M = int(input())
    data = []
    for x in range(M):
        p,x = map(int, input().split())
        p -= 1
        data.append([p, x])
    result = 2 ** 60
    for p,x in data:
        res = 0
        for i,t in enumerate(T):
            if (i == p):
                res += x
            else:
                res += t
        print (res)
Problem p03892 (python)

Fixed submission:
import fractions
if __name__ == "__main__":
    A, B, C, D = map(int, input().split())
    A -= C
    B -= D
    W = abs(A)
    H = abs(B)
    if W == 0 or H == 0:
        print(0)
        exit()
    res = W + H - 1
    g = fractions.gcd(W, H)
    print(res - g + 1)

Buggy submission (verdict: Runtime Error):
import math
if __name__ == "__main__":
    A,B,C,D = map(int, input().split())
    A -= C
    B -= D
    W = abs(A)
    H = abs(B)
    if W == 0 or H == 0:
        print (0)
        exit()
    res = W + H - 1
    g = math.gcd(W, H)
    print (res - g + 1)

Buggy submission (verdict: Runtime Error):
import math
if __name__ == "__main__":
    A,B,C,D = map(int, input().split())
    A -= C
    B -= D
    W = abs(A)
    H = abs(B)
    if W == 0 or H == 0:
        print (0)
        exit()
    res = W + H - 1
    g = math.gcd(W, H)
    print (res - g + 1)
Problem p02767 (python)

Fixed submission:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count

N=int(input())
X=np.array(acinput())

u = round(np.mean(X))


res=0

print(int(np.sum((u-X)**2)))

Buggy submission (verdict: Runtime Error):

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count

N=int(input())
X=np.array(acinput())

u = round(np.mean(X))


res=0

print(int(np.sum((u-X)**2)))
Problem p02789 (python)

Fixed submission:
def acinput():
    return list(map(int, input().split(" ")))


N,M=acinput()

if N==M:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def acinput():
    return list(map(int, input().split(" ")))



import numpy as np
#from functools import reduce
import matha
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
import copy
import functools

N,M=acinput()

if N==M:
    print("Yes")
else:
    print("No")
Problem p02909 (python)

Fixed submission:


def acinput():
    return list(map(int, input().split(" ")))


S=input()
d=["Sunny","Cloudy","Rainy","Sunny"]

print(d[d.index(S)+1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)

import numpy as np

def acinput():
    return list(map(int, input().split(" ")))


S=input()
d=["Sunny","Cloudy","Rainy"]

print(d[d.index(S)+1])