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

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
for i in range(n):
    h[i]=abs(t-h[i]*0.006-a)
print(h.index(min(h))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
for i in range(n):
    h[i]i=abs(t-h[i]*0.006-a)
print(h.index(min(h))+1)
Problem p03240 (python)

Fixed submission:
n=int(input())
xyh=[]
for i in range(n):
    xyh.append(list(map(int,input().split())))
x0=xyh[0][0]
y0=xyh[0][1]
h0=xyh[0][2]
count=0
while h0==0:
    count+=1
    x0=xyh[count][0]
    y0=xyh[count][1]
    h0=xyh[count][2]
for x in range(101):
    for y in range(101):
        h=h0+abs(x-x0)+abs(y-y0)
        for i in range(n):
            if max(0,h-abs(x-xyh[i][0])-abs(y-xyh[i][1]))!=xyh[i][2]:
                break
            if i==n-1:
                print(x,y,h)
                quit()

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
yaku=set()
for i in range(1,m):
    yaku.add(m//i)
import copy
yakuc=copy.copy(yaku)
for i in yakuc:
    if i<n:
        yaku.remove(i)
yakul=list(yaku)
p=yakul[0]
print(m//p)
Problem p02724 (python)

Fixed submission:
X = int(input())
sen = X // 500
amari = X % 500
go = amari // 5
ans = sen * 1000 + go * 5
print(ans)

Buggy submission (verdict: Runtime Error):
X = int(input())
sen = X // 500
amari = X % 500
go = amari // 5
ans = sen * 1000 + gp * 5
Problem p02885 (python)

Fixed submission:
A, B = map(int, input().split())
ans = A - B - B
if ans > 0:
  print(ans)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, B = map(int, innput().split())
ans = A - B - B
if ans > 0:
  print(ans)
else:
  print(0)
Problem p02886 (python)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
ans = 0
num = sum(lis)
for i in range(n):
  num -= lis[i]
  ans += lis[i] * num
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(N):
    if i /= j:
      ans = ans +d[i] * d[j]
ans = ans / 2
print(ans)
Problem p02898 (python)

Fixed submission:
N, K = map(int, input().split());
h = list(map(int, input().split()))
ans = 0
for i in range(N):
  if h[i] >= K:
    ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split());
h = list(map(int, input().split()))
for i in range(N):
  if h[i] >= K:
    ans += 1
print(ans)
Problem p02909 (python)

Fixed submission:
a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
elif a == 'Rainy':
  print('Sunny')

Buggy submission (verdict: Runtime Error):
a = input()
if a == 'Sunny':
  print('Cloudy')
elif a == 'Cloudy':
  print('Rainy')
else
  print('Sunny')

Buggy submission (verdict: Runtime Error):
a = input().strip()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
a = input().split()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
a = input()
if a == 'Sunny':
  print('Cloudy')
else if a == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p02910 (python)

Fixed submission:
s = input()
 
for i in range(len(s)):
  if i % 2 == 0 and s[i] == 'L':
    print('No')
    break
  if i % 2 == 1 and s[i] =='R':
    print('No')
    break
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S = input()
even = S[::2]
odd = S[1::2]
if 'L' in odd or 'R' on even:
  print('No')
else:
  print('Yes')
Problem p02917 (python)

Fixed submission:
N = int(input())
B = list(map(int, input().split()))
ans = B[0]
for i in range(1, N-1):
    ans += min(B[i - 1], B[i])
ans += B[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(0)

for i in range(N):
  if i = 0:
    A[i] = B[i]
  else:
    A[i] = min(B[i], B[i - 1])
    
print(A)

Buggy submission (verdict: Runtime Error):
N = int(input())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(0)

for i in range(N):
  if A[i] > B[i]:
    A[i] = B[i]
  if A[i + 1] > B[i]:
    A[i + 1] = B[i]

print(A)
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
K = A + B
if K % 2 == 0:
  print(K // 2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
A, B = mao(int, input().split())
K = A + B
if K % 2 == 0:
  print(K / 2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
A, B = mao(int, input().split())
K = A + B
if K % 2 == 0:
  print(K / 2)
else:
  print('IMPOSSIBLE')
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a)
for a in a:print(b[(a<b[-1])-2])

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)] 
for i in range(1, N):
  del s[i]
  print(max([s]))

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)] 
for i in range(1, N):
  del s[i]
  print(max(s))
Problem p02995 (python)

Fixed submission:
def bbb(x, y):
    return (x * y) // aaa(x, y)
 
 
def aaa(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return aaa(y, x % y)
 
 
a, b, c, d = map(int, input().split())
bc = b // c
bd = b // d
ac = (a-1) // c
ad = (a-1) // d
aw = (a-1) // bbb(c, d)
bw = b // bbb(c, d)
print((b - a + 1) - (bc - ac) - (bd - ad) + (bw - aw))

Buggy submission (verdict: Runtime Error):
A, B, C D = map(int, input())
ans = 0
for i in range(A, B):
  if i % C == 0 and i % D == 0:
    ans = ans
  else:
    ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C D = map(int, input())
ans = 0
for i in range(A, B):
  if i % C == 0 and i % D == 0:
    ans = ans + 1
print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C D = map(int, input())
ans = 0
for i in range(A, B):
  if i % C == 0 and i % D == 0:
    ans = ans + 1
Problem p02988 (python)

Fixed submission:
n = input()
p = []
input_first = input()
for ki in range(int(n)):
    p = input_first.rstrip().split(' ')
count = 0
for i in range(1,int(n)-1):
    if int(p[i]) > int(p[i-1]) and int(p[i]) < int(p[i+1]):
        count += 1
    elif int(p[i]) < int(p[i-1]) and int(p[i]) > int(p[i+1]):
        count += 1
    else:
        pass
print(count)

Buggy submission (verdict: Runtime Error):
 = input()
p = []
input_first = input()
for ki in range(int(n)):
    p = input_first.rstrip().split(' ')
count = 0
print(p)
for i in range(1,int(n)-1):
    if (int(p[i]) > int(p[i-1]) and int(p[i]) < int(p[i+1])) or (int(p[i]) < int(p[i-1]) and p[i] > p[i+1]):
        count += 1
    else:
        pass
print(count)
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int, input().split())
capacity = a**2 * b

if x > capacity/2:
  nokori = capacity - x
  teihen =  nokori / a * 2 / a
  tan = teihen / a
  degree = math.atan(tan)
  ans = math.degrees(degree)
else:
  teihen =  x / a * 2 / b
  tan = b / teihen
  degree = math.atan(tan)
  ans = math.degrees(degree)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
capacity = a**2 * b

if x > capacity/2:
  nokori = capacity - x
  teihen =  nokori / a * 2 / a
  tan = a / teihen
  degree = math.atan(tan)
  ans = 90 - math.degrees(degree)
else:
  teihen =  x / a * 2 / b
  tan = b / teihen
  degree = math.atan(tan)
  ans = math.degrees(degree)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
capacity = a**2 * b

if x > capacity/2:
  nokori = capacity - x
  teihen =  nokori / a * 2 / a
  tan = a / teihen
  degree = math.atan(tan)
  ans = 90 - math.degrees(degree)
else:
  teihen =  x / a * 2 / b
  tan = b / teihen
  degree = math.atan(tan)
  ans = math.degrees(degree)

print(ans)
Problem p02911 (python)

Fixed submission:
n, k, q = map(int,input().split())
points = [k-q]*n

for i in range(q):
  m = int(input())
  points[m-1] = points[m-1] + 1

for j in range(len(points)):
  if points[j] <= 0:
    print('No')
  else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n, k, q = map(int,input().split())
points = [k-q]*n

for i in range(q):
  m = int(input())
  points[m-1] = points[m-1] + 1
  print(points)

for j in range(len(points)):
  if points[j] <= 0:
    print('No')
  else:
    print('Yes')
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int, input().split()))

a = []
a.append(b[0])

for i in range(1, n-1):
  if b[i-1] <= b[i]:
    a.append(b[i-1])
  elif b[i-1] > b[i]:
    a.append(b[i])
a.append(b[-1])
print(sum(a))

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

a = []

a.append(b[0])

for i in range(1, n-1):
  if b[i-1] <= b[i]:
    a.append(b[i-1])
  elif b[i] <= b[i+1]:
    a.append(b[i+1])
a.append(b[-1])
print(sum(a))

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

a = []

a.append(b[0])

for i in range(1, n-1):
  if b[i-1] <= b[i]:
    a.append(b[i-1])
  elif b[i] <= b[i+1]:
    a.append(b[i+1])
a.append(b[-1])
print(sum(a))
Problem p02743 (python)

Fixed submission:
import math
a, b, c = map(int, input().split())
ans = (a + b - c)**2 > 4 * a * b

if a + b > c:
    print("No")
elif ans:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
ans = math.sqrt(a) + math.sqrt(b) < math.sqrt(c)

if ans:
    print("Yes")
else:
    print("No")
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())

ans = 0

a, b = H // A, H % A
if b == 0:
  print(a)
else:
  print(a+1)

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

# AB = []
# for i in range(N):
#     A, B = map(int, input().split())
#     AB.append((A, B))


d = [0] + [10**18] * H

for hp in range(1, H + 1):
    for ab in AB:
        # print(ab)
        hp_remain = hp - ab[0]
        if hp_remain < 0: hp_remain = 0
        # print(hp_remain)
        c = d[hp_remain] + ab[1]
        if c < d[hp]: d[hp] = c

print(d[H])

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
# AB = [list(map(int, input().split())) for _ in range(N)]

AB = []
for i in range(N):
    A, B = map(int, input().split())
    AB.append((A, B))


d = [0] + [10**18] * H

for hp in range(1, H + 1):
    for ab in AB:
        # print(ab)
        hp_remain = hp - ab[0]
        if hp_remain < 0: hp_remain = 0
        # print(hp_remain)
        c = d[hp_remain] + ab[1]
        if c < d[hp]: d[hp] = c

print(d[H])
Problem p02786 (python)

Fixed submission:
H = int(input())

# monster HP is X
# X==1 >> X=0
# X>1  other 2 monster appear. These 2 mosters have [X/2] HP.
# No.i monster vitalitiy is Hi
# two actions
# attack : reduce 1 vitaility
# special: make vitality 0. Fenek can use K times of specials.
# print(type(2*10**14))

# from collections import deque
#
# print(f"H={H}")
#
# monsters = deque()
# monsters.append(H)
# attack = 0
#
# while monsters:
# # for _ in range(3):
#     hp = monsters.popleft()
#     # print(f"attack to monster(HP={hp})")
#     if hp != 1:
#         # print(f"new 2 monsters(HP={hp//2}) appears!")
#         hp_hp = hp//2
#         monsters.extend([hp_hp, hp_hp])
#         # print(monsters)
#     attack += 1

i = 1
while H > 1:
    H //= 2
    i += 1
# print(attack)
print(2**i - 1)

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


H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
a, b = np.array(AB, dtype=np.int64).reshape(N, 2).T

d = np.zeros(H + 1, dtype=np.int64)

for hp in range(1, H + 1):
    c = d[np.maximum(hp - a, 0)] + b
    d[hp] = np.amin(c)
    print(hp, np.amin(c))

print(d[H])
Problem p02787 (python)

Fixed submission:
import numpy as np


H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
a, b = np.array(AB, dtype=np.int64).reshape(N, 2).T

d = np.zeros(H + 1, dtype=np.int64)

for hp in range(1, H + 1):
    c = d[np.maximum(hp - a, 0)] + b
    d[hp] = np.amin(c)

print(d[H])

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())

AB = [list(map(int, input().split())) for _ in range(N)]

import numpy as np

d = [0] + [10**18] * H

for hp in range(1, H + 1):
    for ab in AB:
        # print(ab)
        hp_remain = np.max(hp - ab[0], 0)
        # if hp_remain < 0: hp_remain = 0
        # print(hp_remain)
        c = d[hp_remain] + ab[1]
        if c < d[hp]: d[hp] = c

print(d[H])
Problem p02789 (python)

Fixed submission:
def main(n, m):
    if n == m:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    n, m = input().split()
    main(n, m)

Buggy submission (verdict: Runtime Error):
a = int(input())
b, c = map(int, input().split())
s = input()

print("{} {}".format( a + b + c, s))

Buggy submission (verdict: Runtime Error):
import sys


def main():
    if sys.argv[1] == sys.argv[2]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
Problem p02768 (python)

Fixed submission:
import functools

def get_mul_inverse(x: int, p: int) -> int:
    return iterative_square(x, p - 2, p)

def _iterative_square(x: int, n: int, p: int) -> int:
    if n <= 1:
        return x
    div, mod = divmod(n, 2)
    return (((iterative_square(x, div, p) ** 2) % p) * x ** mod) % p

def iterative_square(x: int, n: int, p: int) -> int:
    if n <= 0:
        return None

    return _iterative_square(x, n, p)

def factorial(a, b, p):
  x = 1

  x = functools.reduce(lambda x, y: (x * y) % p, range(a, b + 1), 1)
  return x

def com(n, r, p):
  fact_div_r = get_mul_inverse(factorial(1, r, p), p)

  _result = factorial(n - r + 1, n, p)
  result = (_result * fact_div_r) % p
  
  return result


n, a, b = [int(i) for i in input().split()]
p = 10**9 + 7


pow_2_n_1 = iterative_square(2, n, p) - 1

_result = pow_2_n_1 - com(n, a, p)

_result = _result - com(n, b, p)

result = _result % p
print(result)

Buggy submission (verdict: Runtime Error):
from math import factorial

def com(n, r):
  return factorial(n) // facotrial(n - r) // factorial(r)

n, a, b = [int(s) for s in input().split()]

print((2**n - com(n, a) - com(n, b) - 1) % (10**9 + 7))
Problem p03470 (python)

Fixed submission:
# -*- coding:utf-8 -*-



def main():
  n = int(input())
  tmp = {}
  for i in range(n):
    x = int(input())
    if x in tmp.keys():
      tmp[x] += 1
    else:
      tmp[x] = 0
  print(len(tmp))
    
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
n,y = map(int, input().strip().split())
a_x, a_y, a_z = -1, -1, -1
for xi in range(n + 1):
  for yi in range(n - xi + 1):
    zi = n - xi - yi
    if 10000*xi + 5000*yi + 1000*zi == y:
      a_x = xi
      a_y = yi
      a_z = zi
      break
 
print(a_x, a_y, a_z)
Problem p03478 (python)

Fixed submission:
def sum_digits(n):
  sum_ = 0
  while(n > 0):
    sum_ += (n % 10)
    n = (n // 10)
  return sum_
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  total = 0
  for i in range(1, n+1):
    tmp = sum_digits(i)
    
    if (tmp >= a) & (tmp <= b):
      total += i
  print(total)
 
    
if __name__=="__main__":
  main()

Buggy submission (verdict: Runtime Error):
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = n //10
  return sum
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  total = 0
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = (n //10)
  return sum
   
 
  
def main():
  n, a, b = map(int, list(input().strip().split()))
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()

Buggy submission (verdict: Runtime Error):
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += n % 10
    n /= 10
  return sum
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()

Buggy submission (verdict: Runtime Error):

def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += n % 10
    n /= 10
  return sum
   

  
def main():
  n, a, b = map(int, input())
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)

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

Fixed submission:
# -*- coding:utf-8 -*-
r, g, b = map(int, input().strip().split())
 
if (r*100 + g*10 +b) % 4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
# -*- coding:utf-7 -*-
r, g, b = map(int, input().strip().split())

if (r*100 + g*10 +b) % 4 == 0:
  print('YES')
else:
  print('NO')
Problem p03455 (python)

Fixed submission:
i = list(map(int, input().split()))

x = i[0] * i[1]
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p02772 (python)

Fixed submission:
n = int(input())
A=list(map(int,input().split()))
for i in range(n):
    if(A[i]%2==0):
        if(A[i]%5!=0 and A[i]%3!=0):
            print("DENIED")
            exit()
print("APPROVED")

Buggy submission (verdict: Runtime Error):
n = int(input())
A= map(int,input().split())
for i in range(n):
    if(A[i]%2==0):
        if(A[i]%5!=0 or A[i]%3!=0):
            print("DENIED")
            exit()
print("APPROVED")
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = 0
result = 0

for i in range(N-1):
    if H[i] >= H[i+1] and i == N-2:
        ans += 1
        if result < ans:
            result = ans
    elif H[i] >= H[i+1]:
        ans +=1
    else:
        if result < ans:
            result = ans
        ans = 0

print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

result = []

for i in range(N-1):
    ans = 0
    for j in range(N-i-1):
        if H[i + j] >= H[i + j + 1]: 
            ans += 1
        else:
            break
    if ans >= (N-i-2):
        print(ans)
        exit()
    else:
        result.append(ans)

print(max(result))

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

result = []

for i in range(N-1):
    ans = 0
    for j in range(N-i-1):
        if H[i + j] >= H[i + j + 1]: 
            ans += 1
        else:
            break
    result.append(ans)

print(max(result))
Problem p02741 (python)

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
N = int(input())
print(l[N-1])

Buggy submission (verdict: Runtime Error):
import math
a, b, c = map(int, input().split())

result = math.sqrt(a) + math.sqrt(b) < math.sqrt(c)

if result:
    print('Yes')
else:
    print('No')
Problem p02743 (python)

Fixed submission:
a, b, c = map(int, input().split())
d = c - a - b
if d < 0:
    print('No')
elif 4*a*b < d**2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal

a, b, c = map(int, input().split())

a = Decimal(str(a))
b = Decimal(str(b))
c = Decimal(str(c))
ab = Decimal(str(math.sqrt(a * b)))

if a + b + 2ab < c:
    print('Yes')
else:
    print('No')
Problem p02747 (python)

Fixed submission:
s=str(input())
tmp = s.replace('hi','')
if tmp=='':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s=str(inputs())
tmp = s.replace('hi','')
if tmp=='':
  print('Yes')
else:
  print('No')
Problem p02760 (python)

Fixed submission:
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b:
                a[row][col] = 0


def is_bingo():
    # horizontal
    for r in range(3):
        if a[r][0] + a[r][1] + a[r][2] == 0:
            return True
    # vertical
    for c in range(3):
        if a[0][c] + a[1][c] + a[2][c] == 0:
            return True

    if a[0][0] + a[1][1] + a[2][2] == 0:
        return True
    if a[2][0] + a[1][1] + a[0][2] == 0:
        return True

    return False


if is_bingo():
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys

a = [[0] * 3 for _ in range(3)]
a[0] = list(map(int, sys.stdin.readline().strip().split()))
a[1] = list(map(int, sys.stdin.readline().strip().split()))
a[2] = list(map(int, sys.stdin.readline().strip().split()))
n = int(sys.stdin.readline().strip())
b = [0] * n
for i in range(n):
    b[i] = int(sys.stdin.readline().strip())

    for row in range(3):
        for col in range(3):
            if a[row][col] == b[i]:
                a[row][col] = 0


def is_bingo(grid):
    # horizontal
    for row in range(3):
        if a[row][0] == a[row][1] == a[row][2] == 0:
            return True
    # vertical
    for col in range(3):
        if a[1][col] == a[2][col] == a[3][col] == 0:
            return True

    if a[0][0] == a[1][1] == a[2][2] == 0:
        return True
    if a[2][0] == a[1][1] == a[0][2] == 0:
        return True

    return False


if is_bingo(a):
    print('Yes')
else:
    print('No')
Problem p02787 (python)

Fixed submission:
import sys

def main():
    h_and_n_s = sys.stdin.readline().strip().split(' ')
    h, n = [int(s) for s in h_and_n_s]
    a = [-1] * n
    b = [-1] * n

    # max_a = 0
    # ef_i = -1
    for i in range(n):
        a[i], b[i] = [int(s) for s in sys.stdin.readline().strip().split(' ')]
        # max_a = max(max_a, a[i])
        # if a[ef_i] / b[ef_i] < a[i] / b[i]:
        #     ef_i = i

    dp = [float('inf')] * (h+1)

    for point in range(h+1):
        for i in range(n):
            if point <= a[i]:
                dp[point] = min(dp[point], b[i])
                continue

            dp[point] = min(dp[point], dp[point-a[i]] + b[i])

    print(dp[h])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import math
from collections import deque


def main():
    n_d_a = sys.stdin.readline().strip().split(' ')
    n, d, a = [int(s) for s in n_d_a]

    xh = [None] * n

    for i in range(n):
        x, h = [int(s) for s in sys.stdin.readline().strip().split(' ')]
        xh[i] = [x, h]
    xh.sort()

    cur = 0
    attack_rightmost_idx = [-1] * n
    for i in range(n):
        if cur == n:
            attack_rightmost_idx[i] = n-1
            continue
        attack_rightmost_idx[i] = cur
        x, h = xh[i]
        attack_rightmost = x + 2 * d
        while cur < n and xh[cur][0] <= attack_rightmost:
            attack_rightmost_idx[i] = cur
            cur += 1

    events = deque()
    total_damage = 0
    ans = 0
    for i in range(n):
        while events and events[0][0] <= i:
            total_damage += events[0][1]
            events.popleft()

        x, h = xh[i]

        remaining_life = h - total_damage
        if remaining_life <= 0:
            continue

        needed = math.ceil(remaining_life / a)
        ans += needed
        total_damage += needed * a
        events.append((attack_rightmost_idx[i]+1, - needed * a))

    print(ans)


if __name__ == '__main__':
    main()
Problem p03455 (python)

Fixed submission:
given = input()
s = given.split()

a = int(s[0])
b = int(s[1])

if a % 2 and b % 2:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
given = input()
a, b = given.split()
if a % 2 and b % 2:
  print("Odd")
else:
  print("Even")