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

Fixed submission:
l = [[] for _ in range(3)]
for i in range(0, 3):
    l[i] = [int(_) for _ in input().split()]
t = [0, 0, 0]
for i in range(0, 3):
    for j in range(0, 3):
        t[i] += l[j][i]
p = (t[0] - t[1]) / 3
q = (t[0] - t[2]) / 3
if l[0][0]-p == l[0][1] and l[0][0]-q == l[0][2] and l[1][0]-p == l[1][1] and l[1][0]-q == l[1][2] and l[2][0]-p == l[2][1] and l[2][0]-q == l[2][2]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
array = np.zeros((3, 3), dtype="int8")
for i in range(3):
    inputs = map(int, input().split())
    for j in range(3):
        array[i, j] = inputs[j]
    
b_1 = array[0, 0]
b_2 = array[0, 1]
b_3 = array[0, 2]
a_2 = array[1, 0] - b_1
a_3 = array[2, 0] - b_1
if (array[1, 1] == (a_2 + b_2)) & (array[2, 2] == (a_3 + b_3)):
    flag = 1
else:
    flag = 0

if flag:
    print("Yes")
else:
    print("No")
Problem p03449 (python)

Fixed submission:
import numpy as np

N = int(input())
grid = np.zeros((2, N),dtype="int")
for i in range(2):
    grid[i] = np.array([int(x) for x in input().split()])

candy_sums = np.zeros((2, N), dtype="int")
for i in range(2):
    for n in range(N):
        candy_sums[i,n] += grid[i,n]
        if (n-1) >= 0 & (i-1) >= 0:
            candy_sums[i,n] += max(candy_sums[i-1,n], candy_sums[i,n-1])
        elif (i-1) >= 0:
            candy_sums[i,n] += candy_sums[i-1, n]
        elif (n-1) >=0:
            candy_sums[i,n] += candy_sums[i, n-1]
            
print(candy_sums[1,N-1])

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

N = int(input())
grid = np.zeros((2, N),dtype="int")
for i in range(2):
    grid[i] = np.array([int(x) for x in input().split()])

candy_sums = np.zeros((2, N), dtype="int")
for i in range(2):
    for n in range(N):
        candy_sums[i,n] += grid[i,n]
        if (n-1) >= 0 & (i-1) >= 0:
            candy_sums[i,n] += max(candy_sums[i-1,n], candy_sums[i,n-1])
        elif (i-1) >= 0:
            candy_sums[i,n] += candy_sums[i-1, n]
        elif (n-1) >=0:
            candy_sums[i,n] += candy_sums[i, n-1]
            
print(candy_sums[1,N-1])
Problem p03463 (python)

Fixed submission:
N, A, B = map(int, input().split())
if (A-B) % 2 == 0:
    print("Alice")
else:
    print("Borys")

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if (A-B) % 2 == 0:
    print("Alice)
else:
    print("Borys")
Problem p03469 (python)

Fixed submission:
date = input()
new_date = "2018"+date[4:]
print(new_date)

Buggy submission (verdict: Runtime Error):
date = input()
date[3] = "8"
print(date)
Problem p03485 (python)

Fixed submission:
a, b = map(int, input().split())
avg = (a+b) /2
ans = avg*10 // 10
if (avg*10)%10 == 0:
  print(int(ans))
else:
  print(int(ans+1))

Buggy submission (verdict: Runtime Error):
a, b = map(int input())
avg = (a+b) /2
ans = (avg*10) // 10
if (avg*10)%10 == 0:
  print(ans)
else:
  print(ans+1)

Buggy submission (verdict: Runtime Error):
a, b = map(int input())
avg = (a+b) /2
ans = avg // 10
if (avg*10)%10 == 0:
  print(ans)
else:
  print(ans+1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
avg = (a+b) /2
if (avg*10)%10 == 0:
  print(avg)
else:
  print(avg+1)

Buggy submission (verdict: Runtime Error):
a, b = map(int input())
avg = (a+b) /2
if (avg*10)%10 == 0:
  print(avg)
else:
  print(avg+1)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
avg = (a+b) /2
if (avg*10)%10 == 0:
  print(avg)
else:
  print(avg+1)
Problem p03486 (python)

Fixed submission:
s = input()
t = input()

sorted_s = sorted(s)
sorted_t = sorted(t, reverse=True)
len_s = len(sorted_s)
len_t = len(sorted_t)
iter_range = len_s if len_s < len_t else len_t

flag = 0
same_count = 0
for i in range(iter_range):
    s_i = sorted_s[i]
    t_i = sorted_t[i]
    if s_i < t_i:
        flag = 1
        break
    if s_i == t_i:
        same_count+= 1

if (same_count == len_s) & (len_s < len_t):
    print("Yes")
elif (same_count == len_s) & (len_s >= len_t):
    print("No")
elif flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
sorted_s = sorted(s)
sorted_t = sorted(t, reverse=True)

len_s = len(sorted_s)
flag = 0
for i in range(len_s):
    s_i = sorted_s[i]
    t_i = sorted_t[i]
    if s_i < t_i:
        flag = 1
        break
if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
sorted_s = sorted(s)
sorted_t = sorted(t, reverse=True)

len_s = len(sorted_s)
flag = 0
for i in range(len_s):
    s_i = sorted_s[i]
    t_i = sorted_t[i]
    if s_i < t_i:
        flag = 1
        break
if flag:
    print("Yes")
else:
    print("No")
Problem p03502 (python)

Fixed submission:
X = int(input())
X_ = X
x_sum = 0
while True:
    x_sum += X_ % 10
    if (X_ // 10) ==0 :
        break
    else:
        X_ = X_ // 10
if X % x_sum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
X_ = X
x_sum = 0
while True:
    if (X_ // 10) ==0 :
        break
    else:
        x_sum += X_ % 10
        X_ = X_ // 10
if X % x_sum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
X_ = X
x_sum = 0
while True:
    if (X_ // 10) ==0 :
        break
    else:
        x_sum += X_ % 10
        X_ = X_ // 10
if X % x_sum == 0:
    print("Yes")
else:
    print("No")
Problem p03658 (python)

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

sorted_Ls = sorted(Ls, reverse=True)
length_sum = 0
for k in range(K):
    length_sum += sorted_Ls[k]
print(length_sum)

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

sorted_Ls = sorted(Ls, reverse=True)
length_sum = 0
for k in K:
    length_sum += sorted_Ls[k]
print(length_sum)
Problem p03680 (python)

Fixed submission:
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[1] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    
if flag:
    print(num)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)

flag = 0
num = 0
bottun = 0
for _ in range(1e6):
    if light[1] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    
if flag:
    print(num)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[2] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    
if flag:
    print(num)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)
searched = {"".join(light):1}

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[2] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    if searched.get("".join(light)):
        break
    else:
        searched["".join(light)] = 1
    
if flag:
    print(num)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)
searched = {"".join(light):1}

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[2] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    if searched.get("".join(light)):
        break
    else:
        searched["".join(light)] = 1
    
if flag:
    print(num)
else:
    print(-1)
Problem p03693 (python)

Fixed submission:
# スペース区切りの整数の入力
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
# スペース区切りの整数の入力
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES")
else:
  print("NO)

Buggy submission (verdict: Runtime Error):
#a, b, c = map(int, input().split())
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES)
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES)
else:
  @rint("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES)
else:
  @rint("NO")
Problem p03807 (python)

Fixed submission:
_ = input()
As = [int(x) for x in input().split()]
if sum(As)%2 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
_ = input()
As = [int(x) for x in input().split()]
even_pair_count = 0
odd_pair_count = 0
even_pair = []
odd_pair = []
for a in As:
    if a%2 == 0:
        even_pair.append(1)    
        if len(even_pair) == 2:
            even_pair = []
            even_pair_count += 1
    else:
        odd_pair.append(1)
        if len(odd_pair) == 2:
            odd_pair = []
            odd_pair_count += 1


pair_num = even_pair_count + odd_pair_count
rest_num = len(even_pair) + len(odd_pair)
# print(pair_num)
# print(rest_num)
elif rest_num == 2:
    print("NO")
if pair_num == 1:
    print("YES")
elif (pair_num+rest_num) % 2 == 0:
    print("YES")
else:
    print("NO")
Problem p03854 (python)

Fixed submission:
S = input()

candidates = ["dream", "dreamer", "erase", "eraser"]

find_flag = 0
rest_S = S
while True:
#     print(rest_S[-5:], rest_S[-7:]) 
    if len(rest_S) == 0:
        find_flag = 1
        break
    elif (len(rest_S) >= 7) & (rest_S[-7:] in candidates):
        rest_S = rest_S[:-7]
    elif (len(rest_S) >= 6) & (rest_S[-6:] in candidates):
        rest_S = rest_S[:-6]
    elif (len(rest_S) >= 5) & (rest_S[-5:] in candidates):
        rest_S = rest_S[:-5]
    else:
        break

if find_flag:
    print("YES")
else:
    print("NO")

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

find_flag = 0
rest_S = S
while True:
    if len(rest_S) == 0:
        find_flag = 1
        break
    elif rest_S[-5:] in candidates:
        rest_S = rest_S[:-5]
    elif rest_S[-6:] in candidates:
        rest_S = rest_S[:-6]
    else:
        break

if find_flag:
    print("YES")
else:
    print("NO")
Problem p03219 (python)

Fixed submission:
X,Y=map(int,input().split())
print(int(X+Y/2))

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split)
print(int(X+Y/2))

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split);
print(int(X+Y/2));

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split);
print(int(x+Y/2));
Problem p03219 (python)

Fixed submission:
a, b = map(int, input().split())
print(int(a+b/2))

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(str(a+b/2))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(str(a+b/2))
Problem p03219 (python)

Fixed submission:
x,y = map(int,input().split())
print (int(x + y/2))

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
print int(x + y/2)
Problem p03219 (python)

Fixed submission:
x, y = map(int, input().split(' '))
print(x + y // 2)

Buggy submission (verdict: Runtime Error):
x, y = map(int(), input().split(' '))
print(x + y // 2)

Buggy submission (verdict: Runtime Error):
x, y = map(int(), input().split(' '))
print(x + y / 2)
Problem p03219 (python)

Fixed submission:
x, y = input().split(' ')
x = int(x)
y = int(y)
print(int(y / 2 + x))

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = input().split(' ')
t = int(t)
a = int(a)
h = input().split(' ')

diff = 10000
point = 10000

for x in range(n):
    temp = t - int(h[x]) * 0.006
    tmp = abs(a - temp)

    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Buggy submission (verdict: Runtime Error):
x, y = input().split(' ')
x = int(x)
y = int(y)

return y / 2 + x
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = input().split(' ')
t = int(t)
a = int(a)
h = input().split(' ')

diff = 10000
point = 10000

for x in range(n):
    temp = t - int(h[x]) * 0.006
    tmp = abs(a - temp)

    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = input().split(' ')
t = int(t)
a = int(a)
h = input().split(' ')

diff = 100
point = 10000

for x in range(n):
    tmp = t - h[x] * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)
Problem p03284 (python)

Fixed submission:
import math
N, K = list(map(int, input().split()))
x = N / K
print(math.ceil(x) - math.floor(x))

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input()))
a = -(-N//K) - (N//K)
print(a)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input()))
print(-(-N//K) - (N//K))
Problem p03579 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 6)


def dfs(v, c):
    flgs[v] = c
    for i in range(len(G[v])):
        if flgs[G[v][i]] == c:
            return False
        if flgs[G[v][i]] == 0 and not dfs(G[v][i], -c):
            return False

    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    G = [[] for _ in range(N + 1)]
    for i in range(M):
        a, b = map(int, input().split())
        G[a].append(b)
        G[b].append(a)

    # 二部グラフ判定をする
    bi_flg = True
    flgs = [0 for _ in range(N + 1)]
    for i in range(1, N + 1):
        if flgs[i] == 0:
            if not dfs(i, 1):
                bi_flg = False

    if bi_flg:
        # 二部グラフならBW-M
        print(flgs.count(1) * flgs.count(-1) - M)
    else:
        # 二部グラフでないなら全辺-M
        print((N * (N - 1) // 2) - M)

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


def dfs(v, c):
    flgs[v] = c
    for i in range(len(G[v])):
        if flgs[G[v][i]] == c:
            return False
        if flgs[G[v][i]] == 0 and not dfs(G[v][i], -c):
            return False

    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    G = [[] for _ in range(N + 1)]
    for i in range(M):
        a, b = map(int, input().split())
        G[a].append(b)
        G[b].append(a)

    # 二部グラフ判定をする
    bi_flg = True
    flgs = [0 for _ in range(N + 1)]
    for i in range(1, N + 1):
        if flgs[i] == 0:
            if not dfs(i, 1):
                bi_flg = False

    if bi_flg:
        # 二部グラフならBW-M
        print(flgs.count(1) * flgs.count(-1) - M)
    else:
        # 二部グラフでないなら全辺-M
        print((N * (N - 1) // 2) - M)
Problem p03584 (python)

Fixed submission:
import math

if __name__ == '__main__':
    N, K = list(map(int, input().split()))
    integer_value = []
    for i in range(N):
        integer, value = list(map(int, input().split()))
        integer_value.append((integer, value))
    if K == 0:
        r = 0
    else:
        r = int(math.log(K, 2))
    max_value = 0
    for i in range(r + 1):
        # print((K >> i) & 0b1)
        if not ((K >> i) & 0b1):
            continue

        tmp_sum = 0

        mask = 1
        for j in range(i):
            mask = (mask << 1) + 1
        Ki = (K | mask) - 2 ** i

        for tmp_int, tmp_val in integer_value:
            if Ki | tmp_int == Ki:
                tmp_sum += tmp_val

        # print(str(tmp_sum) + " " + str(i))
        if max_value < tmp_sum:
            max_value = tmp_sum

    # K の場合
    K_val = 0
    for tmp_int, tmp_val in integer_value:
        if K | tmp_int == K:
            K_val += tmp_val
    # print("max_val" + str(max_value))
    # print("K_val" + str(K_val))
    if K_val < max_value:
        print(max_value)
    else:
        print(K_val)

Buggy submission (verdict: Runtime Error):
import math

if __name__ == '__main__':
    N, K = list(map(int, input().split()))
    integer_value = []
    for i in range(N):
        integer, value = list(map(int, input().split()))
        integer_value.append((integer, value))
    r = int(math.log(K, 2))
    max_value = 0
    for i in range(r + 1):
        # print((K >> i) & 0b1)
        if not ((K >> i) & 0b1):
            continue

        tmp_sum = 0

        mask = 1
        for j in range(i):
            mask = (mask << 1) + 1
        Ki = (K | mask) - 2 ** i

        for tmp_int, tmp_val in integer_value:
            if Ki | tmp_int == Ki:
                tmp_sum += tmp_val

        # print(str(tmp_sum) + " " + str(i))
        if max_value < tmp_sum:
            max_value = tmp_sum

    # K の場合
    K_val = 0
    for tmp_int, tmp_val in integer_value:
        if K | tmp_int == K:
            K_val += tmp_val
    # print("max_val" + str(max_value))
    # print("K_val" + str(K_val))
    if K_val < max_value:
        print(max_value)
    else:
        print(K_val)
Problem p03627 (python)

Fixed submission:
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    A.sort(reverse=True)

    v = []
    while len(A) > 1:
        if len(v) == 2:
            break

        if A[0] == A[1]:
            v.append(A[0])
            A.pop(0)
            A.pop(0)
        else:
            A.pop(0)

    if len(v) == 1 or len(v) == 0:
        print(0)
    else:
        print(v[0] * v[1])

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    A.sort(reverse=True)

    v = []
    while len(A) != 0:
        if len(v) == 2:
            break

        if A[0] == A[1]:
            v.append(A[0])
            A.pop(0)
            A.pop(0)
        else:
            A.pop(0)

    if len(v) == 1 or len(v) == 0:
        print(0)
    else:
        print(v[0] * v[1])
Problem p03633 (python)

Fixed submission:
import decimal


def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def lcm(a, b):
    g = euclid(a, b)
    # print(g)
    # print(a * b)

    return a * b // g


if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)

Buggy submission (verdict: Runtime Error):
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def lcm(a, b):
    g = euclid(a, b)
    return int(a * b / g)


if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)

Buggy submission (verdict: Runtime Error):
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))

    if N == 1:
        print(T[0])
    else:
        gcd = (T[0] * T[1] / euclid(T[0], T[1]))
        for i in range(2, N):
            gcd = (gcd * T[i] / euclid(gcd, T[i]))

        print(int(gcd))

Buggy submission (verdict: Runtime Error):
def euclid(a, b):
    if b < a:
        tmp = a
        a = b
        b = tmp

    ret = b % a
    if ret == 0:
        return a
    else:
        return euclid(ret, a)


if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))

    if N == 1:
        print(T[0])
    else:
        gcd = (T[0] * T[1] / euclid(T[0], T[1]))
        for i in range(2, N):
            gcd = (gcd * T[i] / euclid(gcd, T[i]))

        print(int(gcd))
Problem p03759 (python)

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

if b - a == c - b:
    print("YES")
else:
    print("NO")

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

sum_x = 0
for i in range(0, n):
    tmp_x = x[i]
    l_x = list(filter(lambda ele: ele > 0, (map(lambda ele: ele - tmp_x, x))))
    sum_x += sum(l_x)

sum_y = 0
for i in range(0, m):
    tmp_y = y[i]
    l_y = list(filter(lambda ele: ele > 0, (map(lambda ele: ele - tmp_y, y))))
    sum_y += sum(l_y)

ans = sum_x * sum_y

divide_num = pow(10, 9) + 7
print(ans % divide_num)
Problem p03219 (python)

Fixed submission:
a, b = map(int, input().split())
if 1 > a or b%2 != 0 or b > 100:
  SystemExit
print(int(a+b/2))

Buggy submission (verdict: Runtime Error):
a,b = map(int input().split())
b = b / 2
result = a + b
print(result)

Buggy submission (verdict: Runtime Error):
a, b = (int(x) for x in input().split())
b = b / 2
result = a + new_b
print(result)
Problem p03219 (python)

Fixed submission:
x, y = map(int, input().split())
print("{}".format(int(x+y/2)))

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
print("{}".format(x+y/2)
Problem p03219 (python)

Fixed submission:
x, y = [int(i) for i in input().split()]
print(int(x + y/2))

Buggy submission (verdict: Runtime Error):
inp = input()
x, y = inp.split()
print(int(x + y/2))

Buggy submission (verdict: Runtime Error):
inp = input()
x, y = inp.split(' ')
print(x + y/2)
Problem p03220 (python)

Fixed submission:
_ = input()
t, desire = map(int, input().split())
places_h = map(int, input().split())

def desire_delta(place_h, t, desire):
  avg_tmp = t - place_h * 0.006
  return max(desire - avg_tmp, avg_tmp - desire)

res = [(idx, desire_delta(h, t, desire)) for idx, h in enumerate(places_h)]

sorted_res = sorted(res, key=lambda place: place[1])

print(sorted_res[0][0] + 1)

Buggy submission (verdict: Runtime Error):
_ = input()
t, desire = map(int, input().split())
places_h = map(int, input().split())

def desire_delta(place_h, t, desire):
  avg_tmp = t - place_h * 0.006
  return max(desire - avg_tmp, avg_tmp - desire)

res = [(idx, desire_delta(h, t, desire)) for idx, h in enumerate(place_h)]

sorted_res = sorted(res, key=lambda idx, delta: delta)

print(sorted_res[0])
Problem p03694 (python)

Fixed submission:
# coding: utf-8
loops = int(input())
LIST = list(map(int, input().split()))

print(max(LIST) - min(LIST))

Buggy submission (verdict: Runtime Error):
loops = int(input())
LIST = [int(input()) for _ in range(loops)]

print(max(LIST) - min(LIST))
Problem p03760 (python)

Fixed submission:
# https://beta.atcoder.jp/contests/abc058/tasks/abc058_b


def solve():
    o = input()
    e = input()

    for l, r in zip(o, e):
        print('{}{}'.format(l, r), end="")

    if len(o) != len(e):
        print(o[-1])
    else:
        print()


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
# https://beta.atcoder.jp/contests/abc058/tasks/abc058_b

from itertools import zip_longest


def solve():
    o = input()
    e = input()
    for l, r in zip_longest(o, e):
        if r is None:
            r = ""
        print(f'{l}{r}', end="")


if __name__ == '__main__':
    solve()
Problem p03288 (python)

Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

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

if R < 1200:
    print('ABC')
elif R < 2800
    print('ARC')
else:
    print('AGC')
Problem p03416 (python)

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

count = 0

for i in range(A, B+1):
    num = []
    while i != 0:
        num.append(i%10)
        i = int(i/10)
    
    if num[0] == num[4] and num[1] == num[3]:
        count += 1


print(count)

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

count = 0
num = []

for i in range(A, B+1):
    while i != 0:
        num.append(i%10)
    
    if num[0] == num[4] and num[1] == num[3]:
        count += 1


print(count)