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

Fixed submission:
# 同じ数字が連続していないこと
passward = input()


def detector(passward):
    passward_list = list(passward)
    for i in range(len(passward)-1):
        if passward_list[i] == passward_list[i+1]:
            print('Bad', end='')
            break
        else :
            if i == len(passward)-2:
                print('Good', end='')
            continue
        

detector(passward)

Buggy submission (verdict: Runtime Error):
import math
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1
d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1
cd = int((c * d) / math.gcd(c, d))
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1
print( b-a+1 - (delta_c + delta_d - delta_cd), end='')

Buggy submission (verdict: Runtime Error):
import math
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1
d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1
cd = (c * d) // math.gcd(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1
print( b-a+1 - (delta_c + delta_d - delta_cd), end='')

Buggy submission (verdict: Runtime Error):
import math
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1
d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1
print( b-a+1 - (delta_c + delta_d - delta_cd), end='')

Buggy submission (verdict: Runtime Error):
import math
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1
d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')
Problem p02995 (python)

Fixed submission:
from fractions import gcd
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
delta_c = b//c - (a-1)//c
delta_d = b//d - (a-1)//d
def lcm(x, y):
    return (x * y) // gcd(x, y)
cd = lcm(c, d)
delta_cd = b//cd - (a-1)//cd
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

Buggy submission (verdict: Runtime Error):
# a から bで　cでもdでも割り切れないものの数を調べる
import math
#from fractions import gcd
Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)
delta_c = b//c - a//c
delta_d = b//d - a//d
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
#    return (x * y) // gcd(x, y)
cd = lcm(c, d)
delta_cd = b//cd - a//cd
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

Buggy submission (verdict: Runtime Error):
import math

Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)

c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1

d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1

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

cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1

num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

Buggy submission (verdict: Runtime Error):
import math

Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)

c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1

d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1

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

cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1

num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

Buggy submission (verdict: Runtime Error):
# a から bで　cでもdでも割り切れないものの数を調べる
import math

Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)

c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1

d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1

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

cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1

# cとdで割り切れる数
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd, end='')

Buggy submission (verdict: Runtime Error):
# a から bで　cでもdでも割り切れないものの数を調べる
import math

Input = input()
a, b, c, d = Input.split()
a, b, c, d = int(a), int(b), int(c), int(d)

c_min = int(a/c) if a % c == 0 else int(a/c) + 1
c_max = int(b/c)
delta_c = c_max - c_min + 1

d_min = int(a/d) if a % c == 0 else int(a/d) + 1
d_max = int(b/d)
delta_d = d_max - d_min + 1

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

cd = lcm(c, d)
cd_min = int(a/cd) if a % c == 0 else int(a/cd) + 1
cd_max = int(b/cd)
delta_cd = cd_max -cd_min + 1

# cとdで割り切れる数
num_cd = delta_c + delta_d - delta_cd
print( b-a+1 - num_cd)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = list(input())
K  = int(input())

l_replace = [s if S[K-1] in s else '*' for s in S]
print(''.join(l_replace))

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

l_replace = [s if S[K] in s else '*' for s in S]
print(''.join(l_replace))

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

for i in range(N):
    if S[i] == S[K]:
         continue
    else:
        S[i] = '*'
print(''.join(S))
Problem p03079 (python)

Fixed submission:
A, B, C = map(int, input().split( ))
if A == B & B==C:
    print('Yes')
else: 
    print('No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split( ))
if A == B & B==C:
        print('Yes')
    else: 
        print('No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B:
    if B==C:
        print(‘Yes’)
    else:
        print(‘No’)
else:
    print(‘No’)

Buggy submission (verdict: Runtime Error):
A, B, C = input(int()).split()
if A == B:
    if B==C:
        print(‘Yes’)
    else:
        print(‘No’)
else:
    print(‘No’)
Problem p03106 (python)

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

yakusuu=[]
yakusuuA = []
yakusuuB = []
for i in range(1,A+1):
  if A% i == 0:
    yakusuuA.append(i)
  
for j in range(1,B+1):
  if B%j == 0:
    yakusuuB.append(j)
    
yakusuu = list(set(yakusuuA) & set(yakusuuB))
yakusuu.append(1)     
print(sorted(yakusuu, reverse=True)[K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

yakusuu=[]
yakusuuA = []
yakusuuB = []
for i in range(1,A+1):
  if A% i == 0:
    yakusuuA.append(i)
  
for j in range(1,B+1):
  if B%j == 0:
    yakusuuB.append(j)
    
yakusuu = set(yakusuuA) & set(yakusuuB)
yakusuu.append(1)     
print(sorted(yakusuu)[K])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

yakusuu=[]
for i in range(1,A):
  if A% i == 0:
    yakusuu.append(i)
  
for j in range(1,B):
  if B%j == 0:
    yakusuu.append(j)
    
print(sorted(yakusuu)[K])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

yakusuu=[]
for i in range(1,A):
  if A% i == 0:
    yakusuu.append(i)
  
for j in range(1,B):
  if B%j == 0:
    yakusuu.append(j)

print(sorted(yakusuu)[K+1])

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

yakusuu=[]
for i in range(1,A):
  if A% i == 0:
    yakusuu.append(i)
  
for j in range(1,B):
  if B%j == 0:
    yakusuu.append(j)

print(sorted(yakusuu)[K+1])
Problem p03112 (python)

Fixed submission:
import bisect
A, B, Q = map(int, input().split())
s = [int(input()) for i in range(A)]
t = [int(input()) for i in range(B)]
x = [int(input()) for i in range(Q)]
inf = [10**13, -10**13]
s = sorted(s+inf)
t = sorted(t+inf)

for i in range(Q):
    s_r = s[bisect.bisect_right(s, x[i])]
    s_l = s[bisect.bisect_left(s, x[i])-1]
    t_r = t[bisect.bisect_right(t, x[i])]
    t_l = t[bisect.bisect_left(t, x[i])-1]
    long = sorted([abs(t_r-s_r)+s_r-x[i], abs(t_l-s_r)+s_r-x[i], abs(t_l-s_l)+x[i]-s_l, abs(t_r-s_l)+x[i]-s_l,
     abs(s_r-t_r)+t_r-x[i], abs(s_l-t_r)+t_r-x[i], abs(s_r-t_l)+x[i]-t_l, abs(s_l-t_l)+x[i]-t_l])
    print(long[0])

Buggy submission (verdict: Runtime Error):
import bisect
A, B, Q = map(int, input().split())
s = [int(input()) for i in range(A)]
t = [int(input()) for i in range(B)]
x = [int(input()) for i in range(Q)]
inf = [10**13, -10**13]
A,B,C=2, 3, 4
s = sorted([100,600]+inf)
t = sorted([400,900,1000]+inf)
x = [150,2000,899,799]

for i in x:
    s_r = s[bisect.bisect_right(s, x[i])]
    s_l = s[bisect.bisect_left(s, x[i])-1]
    t_r = t[bisect.bisect_right(t, x[i])]
    t_l = t[bisect.bisect_left(t, x[i])-1]
    long = sorted([abs(t_r-s_r)+s_r-x[i], abs(t_l-s_r)+s_r-x[i], abs(t_l-s_l)+x[i]-s_l, abs(t_r-s_l)+x[i]-s_l,
     abs(s_r-t_r)+t_r-x[i], abs(s_l-t_r)+t_r-x[i], abs(s_r-t_l)+x[i]-t_l, abs(s_l-t_l)+x[i]-t_l])
    print(long[0])
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
from collections import Counter

N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)
  
c=Counter(a)
    # すべての要素とその出現回数を取り出します。
freq_scores = c.most_common()
    #c.most_common内の最も多い要素[0]の最大出現回数[1]を[0][1]で指定
max_count = freq_scores[0][1]

modes = []
    　#出現回数と最大出現回数が等しいかを確認します。
for num in freq_scores:
	if num[1] == max_count:
    	modes.append(num[0])

print(len(a[modes]))
Problem p03126 (python)

Fixed submission:
import collections
import itertools

N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)

counter = collections.Counter(a)

ret = [letter for letter,count in counter.most_common() if count == counter.most_common()[0][1]]
if N == counter.most_common()[0][1]:
	print(len(ret))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import collections
import itertools

N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extens(b)

counter = collections.Counter(a)

mode_v = counter.most_common()[0][-1]
it = itertools.takewhile(
    lambda kv: kv[-1] == mode_v, counter.most_common()
)
if len(it)>=N:
	print(len(it)>=N)
else:
  	print(0)

Buggy submission (verdict: Runtime Error):
N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)
  
c=Counter(a)
    # すべての要素とその出現回数を取り出します。
freq_scores = c.most_common()
    #c.most_common内の最も多い要素[0]の最大出現回数[1]を[0][1]で指定
max_count = freq_scores[0][1]

modes = []
    　#出現回数と最大出現回数が等しいかを確認します。
for num in freq_scores:
	if num[1] == max_count:
    	modes.append(num[0])

print(len(a[modes]))
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = (int, input().split())
if a*b%2:
  print("Odd")
else:
  print("Evev")
Problem p03323 (python)

Fixed submission:
A,B=[int(a) for a in input().split()]
if A>8 or B>8 :
   print(":(")
else:
   print("Yay!")

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>8 or B>8 :
   print(":(")
else:
   print("Yay!")
Problem p03325 (python)

Fixed submission:
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   c=0
   while arr[i]%2 ==0:
      arr[i]=arr[i]//2
      c=c+1
   ans=ans+c

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(i):
   c=0
   while arr[i]%2 ==0:
      arr[i]=arr[i]//2
      c=c+1
   ans=ans+c

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   ans=ans+int(math.log2(arr[N]))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   ans=ans+math.log2(arr[N])

print(ans)
Problem p03337 (python)

Fixed submission:
a,b = [int(i) for i in input().split()]
m = max(a+b,a-b,a*b)
print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
temp=0
for i in range(N-1):
    S1=S[0:i+1]
    S2=S[i+1:N]
#    print(S1 + " " + S2)
    kaburi=[]
    for s in S1:
        if s in S2 and s not in kaburi:
            kaburi.append(s)
    print (kaburi)
    if len(kaburi)>temp:
        temp = len(kaburi)
print(temp)
Problem p03210 (python)

Fixed submission:
n = int(input())
if n == 7 or n == 5 or n==3:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n == 7 or n == 5 or n==3:
  print('YES')
else
  print('NO')
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
if 3 * A < B:
    print(3 * A)
else:
    print(B)
Problem p02993 (python)

Fixed submission:
sl = list(input())
prev = 'a'
for si in sl:
    if prev == si:
        print('Bad')
        exit()
    prev = si
print('Good')

Buggy submission (verdict: Runtime Error):
s = int(input())
sl = list(str(s))
prev = a
for si in sl:
    if prev == si:
        print('Bad')
        exit()
print('Good')
Problem p03006 (python)

Fixed submission:
n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

if n == 1:
    print(1)
else:
    print(min(costs))

Buggy submission (verdict: Runtime Error):
n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

print(min(costs))

Buggy submission (verdict: Runtime Error):
from itertools import permutations

n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]
xy = sorted(xy, key=lambda xy: xy[0])

costs = []
for per in permutations(xy, n):
    cost = 1
    p = per[1][0] - per[0][0]
    q = per[1][1] - per[0][1]
    for i in range(2, n):
        if not (per[i][0] - per[i-1][0] == p and per[i][1] - per[i-1][1] == q):
            cost += 1
    costs.append(cost)
print(min(costs))
Problem p03071 (python)

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

count = 0
for i in range(2):
    if a < b:
        count += b
        b -= 1
    else:
        count += a
        a -= 1

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
c = 1
for i in range(1,n):
    if h[i] >= max(h[j] for j in range(i)):
        c += 1
print(c)
Problem p03796 (python)

Fixed submission:
n = int(input())

power = 1
for i in range(n):
    power = power * (i+1)%1000000007
    power %= 1000000007

print(power)

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

power = 1
for i in range(n):
    power = power + (i+1)%1000000007
    power %= %1000000007

print(power)
Problem p03068 (python)

Fixed submission:
N = int(input())
S = str(input())
K = int(input())
Char = ''
for i in range(N):
	if S[i] != S[K-1]:
		Char += '*'
	else:
		Char += S[i]
print(Char)

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

S = str(input())

K = int(input())

Char = []

#Muita gambiarra! lol

for i in range(len(S)-(len(S)-N)):

	Char.append(S[i])	if Char[i] != S[K-1]:

		Char[i] = '*'

for i in Char:

	print(i,end='')
Problem p04030 (python)

Fixed submission:
s = input()
s_list = list(s)
out_list = []

for i in range(len(s_list)):
    if s_list[i] == "0":
        out_list.append("0")
    elif s_list[i] == "1":
        out_list.append("1")
    elif s_list[i] == "B":
        if out_list:
            del out_list[-1]

for ol in out_list:
    print(ol, end="")

Buggy submission (verdict: Runtime Error):
s = input()
s_list = list(s)
out_list = []

for i in range(len(s_list)):
    if s_list[i] == "0":
        out_list.append("0")
    elif s_list[i] == "1":
        out_list.append("1")
    elif s_list[i] == "B":
        del out_list[-1]

for ol in out_list:
    print(ol, end="")
Problem p02981 (python)

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


def answer(N, A, B):
    rail = N * A
    taxi = B

    print(min(rail, taxi))


if __name__ == '__main__':
    args = sys.stdin.read().split(' ')
    answer(int(args[0]), int(args[1]), int(args[2]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    return min(rail, taxi)


if __name__ == '__main__':
    args = sys.stdin.read().split(' ')
    answer(args[0], args[1], args[2])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def answer(N, A, B):
    rail = N * A
    taxi = B

    return min(rail, taxi)


if __name__ == '__main__':
    args = sys.stdin
    answer(args[0], args[1], args[2])
Problem p03005 (python)

Fixed submission:
a , b = input().split()
if int(b)==1:
    print(0)
else:
    print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a , b =input().split()
print(a-b)
Problem p02993 (python)

Fixed submission:
s = list(input())

if s[0] == s[1]:
    print("Bad")
elif s[1] == s[2]:
    print("Bad")
elif s[2] == s[3]:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
s = int(input())
digit = lambda i:(digit(i//10) + [i%10]) if i > 0 else []

s = digit(s)
if s[0] == s[1]:
    print("Bad")
elif s[1] == s[2]:
    print("Bad")
elif s[2] == s[3]:
    print("Bad")
else:
    print("Good")
Problem p02994 (python)

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

a = 10**6
b = 0
ans = 0
for i in range(1,N+1):
    if abs(L+i-1) < a:
        a = abs(L+i-1)
        b = i

for i in range(1,N+1):
    if i != b:
        ans += (L+i-1)

print(ans)

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

a = 10**6
b = 0
ans = 0
for i in range(1,N+1):
    if abs(L+i-1) < mina:
        mina = abs(L+i-1)
        minb = i
        
for i in range(1,N+1):
    if i != minb:
        ans += (L+i-1)

print(ans)

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

a = 10**6
b = 0
ans = 0


for i in range(1,N+1):
    if abs(L+i-1) < mina:
        mina = abs(L+i-1)
        minb = i
        print(mina)

for i in range(1,N+1):
    if i != minb:
        ans += (L+i-1)

print(ans)
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split());print(b//-~(a<13)*(a>5))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>5:
    print(B//2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if B%2==0:

    if A>12:
        print(B)
    elif 13>A>5:
        print(round(B/2))
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>5:
    print(round(B/2))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A>12:
    print(B)
elif 13>A>6:
    print(round(B/2))
else:
    print(0)
Problem p02996 (python)

Fixed submission:
import numpy as np
import sys

n = int(input())

# jobs = pd.DataFrame(columns=["cost", "deadline"])

a = []
b = []

for i in range(n):
    aa, bb = map(int, input().split(' '))
    a.append(aa)
    b.append(bb)

a = np.array(a)
b = np.array(b)

sortIndex = np.argsort(b)

a = a[sortIndex]
b = b[sortIndex]

sum = 0
for i in range(n):
    sum += a[i]
    if sum > b[i]:
        print('No')
        sys.exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
import pandas as pd
import sys

n = int(input())

jobs = pd.DataFrame(columns=["cost", "deadline"])

for i in range(n):
    a, b = map(int, input().split(' '))
    jobs.loc[len(jobs)] = [a, b]

jobs = jobs.sort_values("deadline")

sum = 0
for i in range(n):
    sum += jobs.iat[i, 0]
    if sum > jobs.iat[i, 1]:
        print('No')
        sys.exit()

print('Yes')
Problem p03103 (python)

Fixed submission:
import numpy as np
 
n, m = map(int, input().split(' '))
a = []; b = []
for nn in range(n):
    ls = list(map(int, input().split(' ')))
    a.append(ls[0])
    b.append(ls[1])

a = np.array(a)
b = np.array(b)

ind = np.argsort(a)
a = a[ind]
b = b[ind]
    
amount = 0
count = 0
for i in range(len(a)):
    amount += min(b[i], m - count) * a[i]
    count += b[i]
    if count >= m:
        break
 
print(amount)

Buggy submission (verdict: Runtime Error):
import pandas as pd

n, m = map(int, input().split(' '))
ab = pd.DataFrame(columns=["a", "b"])
for nn in range(n):
    ls = list(map(int, input().split(' ')))
    ab.loc[nn] = ls
    
sortedAb = ab.sort_values("a")
amount = 0
count = 0
for i in range(len(sortedAb)):
    amount += min(sortedAb.iat[i, 1], m - count) * sortedAb.iat[i, 0]
    count += sortedAb.iat[i, 1]
    if count >= m:
        break

print(amount)
Problem p03238 (python)

Fixed submission:
old = int(input())

if old == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = []; y = []; h = []

xmin = 0; ymin = 0; xmax = 101; ymax = 101

for i in range(n):
    xx, yy, hh = list(map(int, input().split(' ')))
    x.append(xx)
    y.append(yy)
    h.append(hh)

field = []

for i in range(n):
    if i == 0:
        for xx in range(xmin, xmax):
            f = []
            for yy in range(ymin, ymax):
                f.append(max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0))
            field.append(f)
    
    else:
        for xx in range(xmin, xmax):
            for yy in range(ymin, ymax):
                f = max(abs(xx - x[i]) + abs(yy - y[i]) + h[i], 0)
                if field[xx][yy] != f:
                    field[xx][yy] = -1

maxx = 0; maxy = 0; maxV = 0
for xx in range(xmin, xmax):
    for yy in range(ymin, ymax):
        if maxV <= field[xx][yy]:
            maxx = xx; maxy = yy; maxV = field[xx][yy]

print(str(maxx) + " " + str(maxy) + " " + str(maxV))