Harryxun/testdata huggingface dataset:
Buggy python 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)



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 python 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)


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 python 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)


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 python 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))


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 python 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))


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 python submission (verdict: Time Limit Exceeded):
def C(_mid):
    if _mid <= target_list[K - 1]:
        return True
    else:
        return False


N, K = list(map(int, input().split()))
target_list = []
ab = []
for i in range(N):
    a, b = list(map(int, input().split()))
    ab.append([a, b])

ab.sort(key=lambda x: x[0])
# print(ab)

for i in range(N):
    for j in range(ab[i][1]):
        target_list.append(ab[i][0])

# print(target_list)

lb = 1
ub = 100000
while ub - lb > 1:
    # print(str(lb) + " " + str(ub))
    mid = int((lb + ub) / 2)
    if C(mid):
        lb = mid
    else:
        ub = mid

print(lb)


Fixed submission:
def C(_mid):
    tmp_sum = 0
    if len(ab) <= _mid:
        return False
    for i in range(0, _mid):
        tmp_sum += ab[i][1]
    if tmp_sum < K:
        return True
    else:
        return False


N, K = list(map(int, input().split()))
ab = []
for i in range(N):
    a, b = list(map(int, input().split()))
    ab.append([a, b])

ab.sort(key=lambda x: x[0])

lb = 0
ub = 100000
while ub - lb > 1:
    # print(str(lb) + " " + str(ub))
    mid = int((lb + ub) / 2)
    if C(mid):
        lb = mid
    else:
        ub = mid

print(ab[lb][0])

Buggy python submission (verdict: Time Limit Exceeded):
def C(_mid):
    if _mid <= target_list[K - 1]:
        return True
    else:
        return False


N, K = list(map(int, input().split()))
target_list = []
for i in range(N):
    a, b = list(map(int, input().split()))
    for j in range(b):
        target_list.append(a)

target_list.sort()

lb = 1
ub = 100000
while ub - lb > 1:
    # print(str(lb) + " " + str(ub))
    mid = int((lb + ub) / 2)
    if C(mid):
        lb = mid
    else:
        ub = mid

print(lb)


Fixed submission:
def C(_mid):
    tmp_sum = 0
    if len(ab) <= _mid:
        return False
    for i in range(0, _mid):
        tmp_sum += ab[i][1]
    if tmp_sum < K:
        return True
    else:
        return False


N, K = list(map(int, input().split()))
ab = []
for i in range(N):
    a, b = list(map(int, input().split()))
    ab.append([a, b])

ab.sort(key=lambda x: x[0])

lb = 0
ub = 100000
while ub - lb > 1:
    # print(str(lb) + " " + str(ub))
    mid = int((lb + ub) / 2)
    if C(mid):
        lb = mid
    else:
        ub = mid

print(ab[lb][0])
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(M)]

count = [0 for i in range(N)]

for aibi in ab:
    ai = aibi[0]
    bi = aibi[1]

    if bi < ai:
        tmp = ai
        ai = bi
        bi = tmp

    for j in range(ai - 1, bi - 1):
        count[j] += 1

yes_or_no = True
for num in count:
    if num % 2 == 1:
        yes_or_no = False

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


Fixed submission:
N, M = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(M)]

count = [0 for i in range(N)]

# for aibi in ab:
#     ai = aibi[0]
#     bi = aibi[1]
#
#     if bi < ai:
#         tmp = ai
#         ai = bi
#         bi = tmp
#
#     for j in range(ai - 1, bi - 1):
#         count[j] += 1

for aibi in ab:
    ai = aibi[0]
    bi = aibi[1]
    if ai != 1 and bi != 1:
        count[ai - 1] += 1
        count[bi - 1] += 1
    else:
        if ai == 1:
            count[bi - 1] += 1
        else:
            count[ai - 1] += 1

yes_or_no = True
for num in count:
    if num % 2 == 1:
        yes_or_no = False

if yes_or_no:
    print("YES")
else:
    print("NO")
Buggy python 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)


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

if b - a == c - b:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
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]
    sum_x += sum(list(filter(lambda ele: ele > 0, (map(lambda ele: ele - tmp_x, x)))))

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

ans = sum_x * sum_y

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


Fixed submission:
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):
    sum_x += i * x[i] - (n - (i + 1)) * x[i]

sum_y = 0
for i in range(0, m):
    sum_y += i * y[i] - (m - (i + 1)) * y[i]

ans = sum_x * sum_y

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

Buggy python submission (verdict: Time Limit Exceeded):
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)


Fixed submission:
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):
    sum_x += i * x[i] - (n - (i + 1)) * x[i]

sum_y = 0
for i in range(0, m):
    sum_y += i * y[i] - (m - (i + 1)) * y[i]

ans = sum_x * sum_y

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

Buggy python submission (verdict: Time Limit Exceeded):
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_1 = list(map(lambda ele: ele - tmp_x, x))
    l_x_2 = list(filter(lambda ele: ele > 0, l_x_1))
    sum_x += sum(l_x_2)

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

ans = sum_x * sum_y

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


Fixed submission:
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):
    sum_x += i * x[i] - (n - (i + 1)) * x[i]

sum_y = 0
for i in range(0, m):
    sum_y += i * y[i] - (m - (i + 1)) * y[i]

ans = sum_x * sum_y

divide_num = pow(10, 9) + 7
print(ans % divide_num)
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))

ab = []
for i in range(N):
    ab.append(list(map(int, input().split())))

cd = []
for i in range(M):
    cd.append(list(map(int, input().split())))

for ab_list in ab:
    min_distance = 200000000
    checkpoint = 0
    for cd_list in cd:
        checkpoint += 1
        distance = abs(ab_list[0] - cd_list[0]) + abs(ab_list[1] - cd_list[1])
        if distance < min_distance:
            min_distance = distance
            ans = checkpoint
    print(ans)


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

ab = []
for i in range(N):
    ab.append(list(map(int, input().split())))

cd = []
for i in range(M):
    cd.append(list(map(int, input().split())))

for ab_list in ab:
    min_distance = 400000000
    checkpoint = 0
    for cd_list in cd:
        checkpoint += 1
        distance = abs(ab_list[0] - cd_list[0]) + abs(ab_list[1] - cd_list[1])
        if distance < min_distance:
            min_distance = distance
            ans = checkpoint
    print(ans)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())

for i in range(1, math.floor(math.sqrt(N))):
    if N % i == 0:
        factor = N / i

factor = int(factor)
print(len(str(factor)))


Fixed submission:
import math

N = int(input())

for i in range(1, math.ceil(math.sqrt(N)) + 1):
    if N % i == 0:
        factor1 = N / i
        factor2 = i

factor1 = int(factor1)

if factor1 < factor2:
    print(len(str(factor2)))
else:
    print(len(str(factor1)))
Buggy python submission (verdict: Runtime Error):
import re

first_line = input().split()
n = int(first_line[0])
m = int(first_line[1])

n_list = []
for i in range(n):
    n_list.append(input())
m_list = []
for i in range(m):
    m_list.append(input())

match_flg = False
for i in range(0, n - m + 1):
    matchOb = re.match(m_list[0], n_list[i])
    if matchOb:
        start_pos = matchOb.start()
        end_pos = matchOb.end()
        for j in range(0, m):
            if n_list[i + j][start_pos:end_pos] == m_list[j] and j == m - 1:
                match_flg = True
            elif n_list[i + j][start_pos:end_pos] != m_list[j]:
                break

if match_flg:
    print("Yes")
else:
    print("No")


Fixed submission:
cards = input().split()
alice = int(cards[0])
bob = int(cards[1])

if alice == bob:
    print("Draw")
elif alice == 1:
    print("Alice")
elif bob == 1:
    print("Bob")
elif alice < bob:
    print("Bob")
else :
    print("Alice")
Buggy python submission (verdict: Runtime Error):
a,b = map(int input().split())
b = b / 2
result = a + b
print(result)

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 python submission (verdict: Runtime Error):
a, b = (int(x) for x in input().split())
b = b / 2
result = a + new_b
print(result)

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 python submission (verdict: Runtime Error):
x, y = map(int, input().split())
print("{}".format(x+y/2)

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

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

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

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

Fixed submission:
x, y = [int(i) for i in input().split()]
print(int(x + y/2))
Buggy python 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])


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 python submission (verdict: Time Limit Exceeded):
loops = int(input())
paper = []

# 1 <= loops <= 10^6
for _ in range(loops):
    num = int(input())
    if num in paper:
        paper.remove(num)
    else:
        paper.append(num)
print(len(paper))


Fixed submission:
loops = int(input())
d = {}

# 10^6
for _ in range(loops):
    key = input()
    if key not in d: # ?
        d[key] = 1
    else:
        d[key] += 1

# 10^6
ans = 0
for k,v in d.items():
    if v % 2 != 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
loops = int(input())
LIST = [int(input()) for _ in range(loops)]

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

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

print(max(LIST) - min(LIST))
Buggy python 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()


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 python submission (verdict: Runtime Error):
# https://beta.atcoder.jp/contests/abc057/tasks/abc057_b


class Point(object):
    def __init__(self, x, y):
        self.x = int(x)
        self.y = int(y)

    @staticmethod
    def manhattan(p1, p2):
        return abs(p1.x - p2.x) + abs(p1.y - p2.y)

    def __str__(self):
        return f'(x, y) = ({self.x}, {self.y})'


def solve():
    # Max(n, m) = (50, 50) => 50 * 2
    n, m = map(int, input().split())
    students = []
    for _ in range(n):
        students.append(Point(*input().split()))

    checkpoints = []
    for _ in range(m):
        checkpoints.append(Point(*input().split()))

    for student in students:
        min_dist = 4 * (10 ** 8)
        min_index = 1
        for index, cp in enumerate(checkpoints):
            manhattan = Point.manhattan(student, cp)
            if min_dist > manhattan:
                min_dist = manhattan
                min_index = index + 1
        print(min_index)


if __name__ == '__main__':
    solve()


Fixed submission:
# https://beta.atcoder.jp/contests/abc057/tasks/abc057_b
class Point(object):
    def __init__(self, x, y):
        self.x = int(x)
        self.y = int(y)

    @staticmethod
    def manhattan(p1, p2):
        return abs(p1.x - p2.x) + abs(p1.y - p2.y)

def solve():
    # Max(n, m) = (50, 50) => 50 * 2
    n, m = map(int, input().split())
    students = []
    for _ in range(n):
        students.append(Point(*input().split()))

    checkpoints = []
    for _ in range(m):
        checkpoints.append(Point(*input().split()))

    for student in students:
        min_dist = 4 * (10 ** 8)
        min_index = 1
        for index, cp in enumerate(checkpoints):
            manhattan = Point.manhattan(student, cp)
            if min_dist > manhattan:
                min_dist = manhattan
                min_index = index + 1
        print(min_index)


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
R = int(input())

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

Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python 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)

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 python submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())

if 'Y' in S:
    print('Four')
else:
    print('Three')
    

Fixed submission:
N = int(input())

print(int(N/3))
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
if a*b % 2 :
    print('Odd')
else :
    print('Even')

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

Buggy python submission (verdict: Runtime Error):
a, b = map(input(), split())

if a*b % 2 == 0
     print('Odd')
else
    print('even')

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

if abs(int(math.sqrt(b)) - math.sqrt(b)) < 10e-6 :
    print('Yes')
else:
    print('No')

Fixed submission:
import math

a = input()
b = int(a.replace(' ', ''))

if abs(int(math.sqrt(b)) - math.sqrt(b)) < 10e-6 :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a = input()
b = int(a.replace(' ', ''))

print(b)

if abs(int(math.sqrt(b)) - math.sqrt(b)) < 10e-6 :
    print('Yes')
else:
    print('No')


Fixed submission:
import math

a = input()
b = int(a.replace(' ', ''))

if abs(int(math.sqrt(b)) - math.sqrt(b)) < 10e-6 :
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import math

a = input()
a = a.strip()

if isinstance(math.sqrt(a), int):
    print('Yes')
else:
    print('No')


Fixed submission:
import math

a = input()
b = int(a.replace(' ', ''))

if abs(int(math.sqrt(b)) - math.sqrt(b)) < 10e-6 :
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
k = input()
k = int(k)
if k % 2 == 0:
    print((k/2)**2)
else:
    print(k//2)*(k//2+1)

Fixed submission:
k = int(input())
if k % 2 == 0:
    print(int((k/2)**2))
else:
    print(int(k//2)*(k//2+1))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
t,a = map(int, input().split())
h = input().split()

h = np.array(h, dtype = float)
h = t - 0.006 * h
h = abs(a-h)
print(np.argmin(h)+1)







Fixed submission:

x, y = map(int, input().split())

print(x + int(y/2))