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

Fixed submission:
from fractions import gcd

N, M = map(int,input().split())
S = input()
T = input()
L = (N*M)//gcd(N,M)
S_a = L // N
T_a = L // M
L_a = (S_a*T_a)//gcd(S_a,T_a)

S_b = L_a // S_a
T_b = L_a // T_a
i = 0
j = 0
while True:
    if S[i] != T[j]:
        print('-1')
        break
    i += S_b
    j += T_b
    if i >= N or j >= M:
        print(L)
        break

Buggy submission (verdict: Runtime Error):
from fractions import gcd

N, M = map(int,input().split())
S = input()
T = input()
L = (N*M)//gcd(N,M)
ans = [0] * (L+1)
for i in range(1,N+1):
    ans[1+(i-1)*(L//N)] = S[i-1]

for i in range(1,M+1):
    if ans[1+(i-1)*(L//M)] == 0:
        ans[1+(i-1)*(L//M)] = T[i-1]
    else:
        if ans[1+(i-1)*(L//M)] == T[i-1]:
            pass
        else:
            print(-1)
            exit()

print(L)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

N, M = map(int,input().split())
S = input()
T = input()
L = N*M//gcd(N,M)
ans = [0] * (L+1)
for i in range(1,N+1):
    ans[1+(i-1)*(L//N)] = S[i-1]

for i in range(1,M+1):
    if ans[1+(i-1)*(L//M)] == 0:
        ans[1+(i-1)*(L//M)] = T[i-1]
    else:
        if ans[1+(i-1)*(L//M)] == T[i-1]:
            pass
        else:
            print(-1)
            exit()

print(L)
Problem p03244 (python)

Fixed submission:
import collections

n = int(input())
v = list(map(int,input().split()))
v1 = v[::2]
v2 = v[1::2]
v1 = collections.Counter(v1)
v2 = collections.Counter(v2)
ans = 0
if v1.most_common()[0][0] == v2.most_common()[0][0]:
    if v1.most_common()[0][1] < v2.most_common()[0][1]:
        ans += n//2 - v2.most_common()[0][1]
        ans += n//2 - v1.most_common()[1][1]
        print(ans)
    elif v1.most_common()[0][1] > v2.most_common()[0][1]:
        ans += n//2 - v1.most_common()[0][1]
        ans += n//2 - v2.most_common()[0][1]
        print(ans)
    else:
        if v1.most_common()[0][1] == n//2:
            print(n//2)
        else:
            if v1.most_common()[1][1] > v2.most_common()[1][1]:
                ans += n//2 - v2.most_common()[0][1]
                ans += n//2 - v1.most_common()[1][1]
                print(ans)
            else:
                ans += n//2 - v1.most_common()[0][1]
                ans += n//2 - v2.most_common()[1][1]
                print(ans)
else:
    ans += n//2 - v1.most_common()[0][1]
    ans += n//2 - v2.most_common()[0][1]
    print(ans)

Buggy submission (verdict: Runtime Error):
import collections

n = int(input())
v = list(map(int,input().split()))
v1 = v[::2]
v2 = v[1::2]
v1 = collections.Counter(v1)
v2 = collections.Counter(v2)
ans = 0
if v1.most_common()[0][0] == v2.most_common()[0][0]:
    if v1.most_common()[0][1] < v2.most_common()[0][1]:
        ans += n//2 - v2.most_common()[0][1]
        ans += n//2 - v1.most_common()[1][1]
        print(ans)
    elif v1.most_common()[0][1] > v2.most_common()[0][1]:
        ans += n//2 - v1.most_common()[0][1]
        ans += n//2 - v2.most_common()[0][1]
        print(ans)
    else:
        if v1.most_common()[0][1] == n//2:
            print(N//2)
        else:
            if v1.most_common()[1][1] > v2.most_common()[1][1]:
                ans += n//2 - v2.most_common()[0][1]
                ans += n//2 - v1.most_common()[1][1]
                print(ans)
            else:
                ans += n//2 - v1.most_common()[0][1]
                ans += n//2 - v2.most_common()[1][1]
                print(ans)
else:
    ans += n//2 - v1.most_common()[0][1]
    ans += n//2 - v2.most_common()[0][1]
    print(ans)
Problem p03260 (python)

Fixed submission:
A,B = map(int, input().split())
if A * B % 2 == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)

print(distance[0])

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

Buggy submission (verdict: Runtime Error):
A,B = int(input().split())
if A * B % 2 == 0:
    print("No")
else:
    print("Yes")
Problem p03262 (python)

Fixed submission:
from functools import reduce
import fractions

N, X = map(int,input().split())
x = list(map(int,input().split()))
x = list(map(lambda x:abs(x-X), x))
x = reduce(lambda a,b: fractions.gcd(a,b), x)
print(x)

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        distance.append(cd)
        del distance[0]
        del distance[0]

print(distance[0])

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)

print(distance[0])

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while True:
    if len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)
        if len(distance) == 1:
            print(distance[0])
            exit()
    else:
        print(distance[0])
        break

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while True:
    if len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)
        if len(distance) == 1:
            print(distance[0])
            exit()
    else:
        print(distance[0])
        exit()

Buggy submission (verdict: Runtime Error):
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while True:
    if len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)
        if len(distance) == 1:
            print(distance[0])
            exit()
    else:
        print(distance[0])
Problem p03289 (python)

Fixed submission:
s = list(input())
count = 0

if s[0] == "A":
    for i in range(2,len(s)-1):
        if s[i] == "C":
            count += 1
    if count != 1:
        print("WA")
        exit()
    else:
        number = s.index("C")
else:
    print("WA")
    exit()

del s[number]
del s[0]

for j in s:
    c = j.lower()
    if c == j:
        continue
    else:
        print("WA")
        exit()
print("AC")

Buggy submission (verdict: Runtime Error):
s = list(input())
count = 0

if s[0] == "A":
    for i in range(2,len(s)-1):
        if s[i] == "C":
            count += 1
    if count != 1:
        print("WA")
        exit()
    else:
        number = s.index("C")
else:
    print("WA")
    exit()

s.remove(0)
s.remove(number)

for j in s:
    c = j.lower()
    if c == j:
        continue
    else:
        print("WA")
        exit()
print("AC")
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
if abs(a - c) > d:
    if abs(b - a) > d or abs(b - c) > d:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if abs(a - c) > d:
    if abs(b - a) > d or abs(b - c) > d:
        pint("No")
    else:
        print("Yes")
else:
    print("Yes")
Problem p03361 (python)

Fixed submission:
H, W = map(int,input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    s[i] = [0] + s[i] + [0]
s = [[0]*(W+2)] + s + [[0]*(W+2)]
for i in range(1,H+1):
    for j in range(1,W+1):
        if s[i][j] == '#':
            if s[i-1][j] == '#' or s[i][j-1] == '#' or s[i][j+1] == '#' or s[i+1][j] == '#':
                continue
            else:
                print('No')
                exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int,input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    s[i] = [0] + s[i] + [0]
s = [[0]*W] + s + [[0]*W]
for i in range(1,H+1):
    for j in range(1,W+1):
        if s[i][j] == '#':
            if s[i-1][j] == '#' or s[i][j-1] == '#' or s[i][j+1] == '#' or s[i+1][j] == '#':
                continue
            else:
                print('No')
                exit()
print('Yes')
Problem p03380 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
MAX = max(A)
r_A = MAX / 2
del A[A.index(MAX)]
B = list(map(lambda a:abs(a-r_A),A))
B.sort()
r1 = int(r_A + B[0])
r2 = int(r_A - B[0])
if r1 in A:
    print(MAX, r1)
else:
    print(MAX, r2)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0

def combination(n,r):
    return math.factorial(n) / (math.factorial(n-r) * math.factorial(r))

for i in range(1,N):
    for j in range(0,i):
        if ans < combination(a[i], a[j]):
            ans = combination(a[i], a[j])
            n = a[i]
            r = a[j]
print(n, r)
Problem p03408 (python)

Fixed submission:
import collections

blue = int(input())
blue_string = [input() for i in range(blue)]
blue_type = set(blue_string)
red = int(input())
red_string = [input() for i in range(red)]
red_type = set(red_string)
result = [0]

for i in blue_type:
    bulue_sort_count = blue_string.count(i)
    red_sort_count = red_string.count(i)
    result.append(bulue_sort_count - red_sort_count )
print(max(result))

Buggy submission (verdict: Runtime Error):
import collections

blue = int(input())
blue_string = [input() for i in range(blue)]
blue_type = set(blue_string)
red = int(input())
red_string = [input() for i in range(red)]
red_type = set(red_string)
blue_number = len(blue_type)
result = [0]

for i in range(blue_number):
    blue_sort = blue_type[i]
    bulue_sort_count = blue_string.count(blue_sort)
    red_sort_count = red_string.count(blue_sort)
    result.append(bulue_sort_count - red_sort_count )
print(max(result))
Problem p03449 (python)

Fixed submission:
import numpy as np

N = int(input())
A_u = np.cumsum(list(map(int,input().split())))
A_d = np.cumsum(list(map(int,input().split())))
ans = 0
if N == 1:
    print(A_u[0]+A_d[0])
    exit()
for i in range(N):
    if i == 0:
        ans = max(ans, A_u[i]+A_d[-1])
    else:
        ans = max(ans, A_u[i]+A_d[-1]-A_d[i-1])
print(ans)

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

N = int(input())
A_u = np.cumsum(list(map(int,input().split())))
A_d = np.cumsum(list(map(int,input().split())))
ans = 0
if N == 1:
    print(A_u[0]+A_d[0])
    exit()
for i in range(N):
    if i == 0:
        ans = max(ans, A_u[i]+A[-1])
    else:
        ans = max(ans, A_u[i]+A_d[-1]-A_d[i-1])
print(ans)
Problem p03477 (python)

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

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

Fixed submission:
s = list(input())
t = list(input())
a = 0

s.sort()
t.sort()
t = t[::-1]

if len(s) < len(t):
    for i in range(len(s)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(s):
        print("Yes")

else:
    for i in range(len(t)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(t):
        print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
a = 0

s.sort()
t.sort()
t = t[::-1]

if len(s) < len(t):
    for i in range(len(s)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(s):
        print("Yes")

else:
    for i in range(len(s)):
        if s[i] < t[i]:
            print("Yes")
            break
        elif s[i] == t[i]:
            a += 1
            continue
        else:
            print("No")
            break
    if a == len(s):
        print("No")
Problem p03501 (python)

Fixed submission:
N,A,B = map(int, input().split())
if N * A >= B:
    print(B)
else:
    print(N * A)

Buggy submission (verdict: Runtime Error):
N = input()
sum = 0

for i in N:
    sum += int(i)
if int(N) % sum == 0:
    print("Yes")
else:
    print("No")
Problem p03502 (python)

Fixed submission:
N = input()
sum = 0

for i in N:
    sum += int(i)
if int(N) % sum == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = input()
sum = 0

for i in N:
    sum += i
if N % sum == 0:
    print("Yes")
else:
    print("No")
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2 * G - R)

Buggy submission (verdict: Runtime Error):
R = input()
G = input()
print(2 * G - R)
Problem p03591 (python)

Fixed submission:
s = input()
s_list = []
ans = ['Y', 'A', 'K', 'I']
for i in s:
    s_list.append(i)
s_list = s_list[:4]
if s_list == ans:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] == 'Y' and s[1] == 'A' and s[2] == 'K' and s[3] == 'I':
    print('Yes')
    exit()
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] == 'Y' and s[1] == 'A' and s[2] == 'K' and s[3] == 'I':
    print('Yes')
else:
    print('No')
Problem p03605 (python)

Fixed submission:
N = input()
result = 0
for i in N:
    if int(i) == 9:
        result += 1
if result >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
result = 0
for i in N:
    if int(i) == 9:
        result += 1
if result >= 1:
    print("Yes")
else:
    print("No")
Problem p03611 (python)

Fixed submission:
import collections

N = int(input())
a = list(map(int,input().split()))
b = collections.Counter(a)
dp = [0] * (max(a)+1)
if len(b) == 1 and a[0] == 0:
    print(N)
    exit()
dp[0] = b[0] + b[1]
dp[1] = dp[0] + b[2]

for i in range(2, max(a)+1):
    dp[i] = dp[i-1] + b[i+1] - b[i-2]
print(max(dp))

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
a = list(map(int,input().split()))
b = collections.Counter(a)
dp = [0] * (max(a)+1)
dp[0] = b[0] + b[1]
dp[1] = dp[0] + b[2]
for i in range(2, max(a)+1):
    dp[i] = dp[i-1] + b[i+1] - b[i-2]
print(max(dp))
Problem p03623 (python)

Fixed submission:
x,a,b = map(int, input().split())
if abs(x -a) >= abs(x - b):
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input())
if abs(x -a) > abs(x - b):
    print("B")
else:
    print("A")
Problem p03625 (python)

Fixed submission:
import collections

N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = []
for a,c in B.items():
    C += [a] * (c//2)
C.sort()

if len(C) >= 2:
    print(C[-1]*C[-2])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
A = list(map(int,input().split())), reverse = True
B = collections.Couter(A)
C = []
for a,c in B.items():
    C += [a] * c//2
C.sort()

if len(C) >= 2:
    print(C[-1]*C[-2])
else:
    print(0)
Problem p03645 (python)

Fixed submission:
N, M = map(int, input().split())
A = set()
B = set()

for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        A.add(b)
    elif b == N:
        B.add(a)

if A & B:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
N, M = map(int,input().split())
A = []
B = []
for _ in range(M):
    a,b = map(int,input().split())
    if a == 1:
        B.append(b)
    if b == N:
        A.appned(a)
for a in A:
    if a in B:
        print('POSSIBLE')
        exit()
print('IMPOSSIBLE')
Problem p03680 (python)

Fixed submission:
N = int(input())
button_list = [int(input()) for i in range(N)]
button =  1
count = 0

while True:
    button = button_list[button-1]
    count += 1
    if button == 2:
        break
    if count == N:
        print(-1)
        exit()
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]
ans = 1
seen = [0] * N
seen[0] = 1
now = a[0]

while True:
    if now == 1 or seen[now] == 1:
        print(-1)
        break
    if now == 2:
        print(ans)
        break
    now = a[now-1]
    seen[now] = 1
    ans += 1
Problem p03695 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), len(color)+f)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), min(len(color)+f))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input()))
color = {}
f = 0
for a in A:
    if 1 <= a <= 399:
        color['g'] = 1
    elif 400 <= a <= 799:
        color['br'] = 1
    elif 800 <= a <= 1199:
        color['gr'] = 1
    elif 1200 <= a <= 1599:
        color['m'] = 1
    elif 1600 <= a <= 1999:
        color['b'] = 1
    elif 2000 <= a <= 2399:
        color['y'] = 1
    elif 2400 <= a <= 2799:
        color['o'] = 1
    elif 2800 <= a <= 3199:
        color['r'] = 1
    else:
        f += 1
print(max(1, len(color)), min(8, len(color)+f))
Problem p03713 (python)

Fixed submission:
H, W = map(int,input().split())
ans = float('inf')
for i in range(1, H):
    a = i*W
    if H-i == 1:
        d = 1*(W//2)
        e = H*W-a-d
        small = min(a,d,e)
        large = max(a,d,e)
        ans = min(ans, large-small)
    else:
        b = ((H-i)//2) * W
        c = H*W-a-b
        d = (H-i) * (W//2)
        e = H*W-a-d
        small1 = min(a,b,c)
        large1 = max(a,b,c)
        small2 = min(a,d,e)
        large2 = max(a,d,e)
        ans = min(ans, large1-small1, large2-small2)
for j in range(1, W):
    a = j*H
    if W-j == 1:
        d = 1*(H//2)
        e = H*W-a-d
        small = min(a,d,e)
        large = max(a,d,e)
        ans = min(ans, large-small)
    else:
        b = ((W-j)//2) * H
        c = H*W-a-b
        d = (W-j) * (H//2)
        e = H*W-a-d
        small1 = min(a,b,c)
        large1 = max(a,b,c)
        small2 = min(a,d,e)
        large2 = max(a,d,e)
        ans = min(ans, large1-small2, large2-small2)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

H, W = map(int,input().split())
ans = math.inf
for i in range(1, H):
    a = i*W
    if H-i == 1:
        d = 1*(W//2)
        e = H*W-a-d
        small = min(a,d,e)
        large = max(a,d,e)
        ans = min(ans, large-small)
    else:
        b = ((H-i)//2) * W
        c = H*W-a-b
        d = (H-i) * (W//2)
        e = H*W-a-d
        small1 = min(a,b,c)
        large1 = max(a,b,c)
        small2 = min(a,d,e)
        large2 = max(a,d,e)
        ans = min(ans, large1-small1, large2-small2)
for j in range(1, W):
    a = j*H
    if W-j == 1:
        d = 1*(H//2)
        e = H*W-a-d
        small = min(a,d,e)
        large = max(a,d,e)
        ans = min(ans, large-small)
    else:
        b = ((W-j)//2) * H
        c = H*W-a-b
        d = (W-j) * (H//2)
        e = H*W-a-d
        small1 = min(a,b,c)
        large1 = max(a,b,c)
        small2 = min(a,d,e)
        large2 = max(a,d,e)
        ans = min(ans, large1-small2, large2-small2)
print(ans)
Problem p03759 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b - a == c - b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
odd = input()
even =input()
even = str(0)+even
odd_list = []
even_list = []

for (a,b) in zip(odd,even):
    odd_list.append(a)
    even_list.append(b)
even_list.append("")
del even_list[0]

for i in range(len(odd_list)):
    print(odd_list[i],end = "")
    print(even_list[i],end = "")
Problem p03830 (python)

Fixed submission:
from functools import reduce
N = int(input())
A = list(range(2,N+1))
sqrt = N**(1/2)
idx = 0
if N == 1:
    print(1)
    exit()
while True:
    p = A[idx]
    if p > sqrt:
        break
    check_numbers = A[idx+1:]
    for check_number in check_numbers:
        if check_number % p == 0:
            A.remove(check_number)
    idx += 1

ans = 1
B = [1] * 1001
for n in range(2, N+1):
    for a in A:
        if n == 1:
            break
        while True:
            if n % a == 0:
                B[a] += 1
                n //= a
            else:
                break
MOD = 10**9+7
print(reduce(lambda a,b: a*b , B)%MOD)

Buggy submission (verdict: Runtime Error):
from functools import reduce
N = int(input())
A = list(range(2,N+1))
sqrt = N**(1/2)
idx = 0
if N == 1:
    print(1)
while True:
    p = A[idx]
    if p > sqrt:
        break
    check_numbers = A[idx+1:]
    for check_number in check_numbers:
        if check_number % p == 0:
            A.remove(check_number)
    idx += 1

ans = 1
B = [1] * 1001
for n in range(2, N+1):
    for a in A:
        if n == 1:
            break
        while True:
            if n % a == 0:
                B[a] += 1
                n //= a
            else:
                break
MOD = 10**9+7
print(reduce(lambda a,b: a*b , B)%MOD)
Problem p03846 (python)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
MOD = 10**9+7
if N == 1:
    print(1)
    exit()
if N % 2 == 0:
    for i in range(1, N//2+1):
        if A[(i-1)*2] == A[1+(i-1)*2] == 2*i-1:
            pass
        else:
            print(0)
            exit()
    print(2**(N//2)%MOD)
else:
    if A[0] == 0 and A[1] != 0:
        for i in range(1, N//2+1):
            if A[2*i-1] == A[2*i] == 2*i:
                pass
            else:
                print(0)
                exit()
        print(2**(N//2)%MOD)
    else:
        print(0)
        exit()

Buggy submission (verdict: Runtime Error):
N = int(input())
A = sorted(list(map(int,input().split())))
if N % 2 == 0:
    for i in range(1, N//2+1):
        if A[(i-1)*2] == A[1+(i-1)*2] == 2*i-1:
            continue
        else:
            print(0)
            exit()
    print(2**(N//2))
else:
    if A[0] == 0 and A[1] != 0:
        for i in range(1, N//2+1):
            if A[2*i-1] == A[2*i] == 2*i:
                continue
            else:
                print(0)
                exit()
        print(2**(N//2))
    else:
        print(0)
        exit()
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))

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

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