Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
A = [[int(i) for i in input().split()] for i in range(n)]
B = np.array(b).reshape(m,1)
cnt = 0
for i in range(m):
    x = np.dot(A[i], B)+c
    if x >0:
    	cnt += 1
    print(cnt)

Fixed submission:
import numpy as np
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
A = [[int(i) for i in input().split()] for i in range(n)]
B = np.array(b).reshape(m,1)
cnt = 0
for i in range(n):
    x = np.dot(A[i], B)+c
    if x >0:
    	cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
A = [[int(i) for i in input().split()] for i in range(n)]
B = np.array(b).reshape(m,1)
cnt = 0
for i in range(m):
    x = np.dot(A[i], B)+c
    if x >0:
    	cnt += 1

print(cnt)

Fixed submission:
import numpy as np
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
A = [[int(i) for i in input().split()] for i in range(n)]
B = np.array(b).reshape(m,1)
cnt = 0
for i in range(n):
    x = np.dot(A[i], B)+c
    if x >0:
    	cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(input().split())

Fixed submission:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(input().split())
    
x_int = [float(j) for j in x]

Fixed submission:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

Fixed submission:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)


Fixed submission:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans)

Fixed submission:
import numpy as np
N = int(input())
x = [0]*N
u = [0]*N
for i in range(N):
    x[i], u[i]= map(str, input().split())
    
x_int = [float(j) for j in x]
u_replace = [1 if k =="JPY" else 380000.0 for k in u]

x_arr = np.array(x_int)
u_arr = np.array(u_replace).reshape(N, 1)

ans = np.dot(x_arr, u_arr)
print(ans[0])
Buggy python submission (verdict: Runtime Error):
n = int(input)
l = list(map(int, input().split()))


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input)
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input)
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input)
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
if x < (s-x):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(b[::2])-sum(b[1::2]))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(b[::2])-sum(b[1::2]))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = sorted(list(map(int, input.split())), reverse=True)
a = sum(data[::2])
b = sum(data[1::2])
print(a - b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = list(map(int, input.split()))
datad = data.sort(reverse = True)
a = sum(datad[::2])
b = sum(datad[1::2])
print(a - b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = list(map(int, input.split()))
data_d = data.sort(reverse = True)
a = sum(data_d[::2])
b = sum(data_d[1::2])
print(a - b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = list(map(int, input().split()))
data_d = data.sort(reverse = True)
a = sum(data_d[::2])
b = sum(data_d[1::2])
print(a - b)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
data = list(map(int, input().split()))
data_d = data.sort(reverse = True)
a = sum(data_d[: : 2])
b = sum(data_d[1: : 2])
ans = a-b
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = a.sort(reverse = True)
print(sum(a[::2])-sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0. c+1):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(0, a+1):
    for j in range(0,b+1):
        for k in range(0,c+1):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0. c+1):
            if 500*i + 100*j + 50*k == x
                ans += 1
print(ans)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(0, a+1):
    for j in range(0,b+1):
        for k in range(0,c+1):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input())
if a*b%2==0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a,b = map(int, input().split())
c = a*b
if c%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t,x,y = map(int, input(),split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	break
print("Yes")

Fixed submission:
n = int(input())
for i in range(n):
    t,x,y = map(int, input().split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input)
for i in range(n):
    t,x,y = map(int, input(),split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	exit()
print("Yes")

Fixed submission:
n = int(input())
for i in range(n):
    t,x,y = map(int, input().split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input)
for i in range(n):
    t,x,y = map(int, input(),split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	break
print("Yes")

Fixed submission:
n = int(input())
for i in range(n):
    t,x,y = map(int, input().split())
    if x+y>t or (x+y+t)%2 :
    	print("No")
    	exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(0, n+1):
    for j in range(0, n+1-i):
    	if 10000*i+5000*j+1000*(n-i-j) == y:
    			print(i, j, n-i-j)
    		else:
    			print(-1, -1, -1)

Fixed submission:
n, y = map(int, input().split())
ans = (-1, -1, -1)
for i in range(0, n+1):
    for j in range(0, n+1-i):
    	if 10000*i+5000*j+1000*(n-i-j) == y:
    		ans = (i, j, n-i-j)
print(ans[0], ans[1], ans[2])
Buggy python submission (verdict: Runtime Error):
print(input().count(1))

Fixed submission:
s = input()
ans = 0
if s[0]=="1":
    ans += 1
    
if s[1]=="1":
    ans += 1

if s[2]=="1":
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
if s[0]=="1":
    ans  += 1
elif s[1]=="1":
    ans  += 1
else s[2]=="1":
    ans += 1
print(ans)

Fixed submission:
s = input()
ans = 0
if s[0]=="1":
    ans += 1
    
if s[1]=="1":
    ans += 1

if s[2]=="1":
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
if s[0]=="1":
    ans  += 1
if s[1]=="1":
    ans  += 1
if s[2]=="1"
    ans += 1
print(ans)

Fixed submission:
s = input()
ans = 0
if s[0]=="1":
    ans += 1
    
if s[1]=="1":
    ans += 1

if s[2]=="1":
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
if s[0]=="1":
    ans = += 1
if s[1]=="1":
    ans = += 1
if s[2]=="1"
    ans += 1
print(ans)

Fixed submission:
s = input()
ans = 0
if s[0]=="1":
    ans += 1
    
if s[1]=="1":
    ans += 1

if s[2]=="1":
    ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for in a]
    cnt += 1
print(cnt)


Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for in a]
    cnt += 1
print(cnt)


Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt=0
while all(i%2==0 for i in a) :
    a = [i/2 for in a]
    cnt += 1
print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt=0
while all(i%2==0 for i in a):
    a = [i/2 for in a]
    cnt += 1
print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
cnt=0
while all(i%2==0 for i in a):
    a = [i/2 for in a]
    cnt += 1
    
print(cnt)

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt = 0
while all(i%2==0 for i in a):
    a = [i/2 for i in a]
    cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
mat = [[0 for i in range(N)] for j in range(N)]
for j in range(M):
    a, b = [int(x) for x in input().split()]
    mat[a - 1][b - 1] = H[b - 1]
    mat[b - 1][a - 1] = H[a - 1]

count = 0
for i in range(N):
    h = H[i]
    max_h = max(mat[i])
    if h > max_h:
        count += 1
print(count)

Fixed submission:
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
nodes = [1 for i in range(N)]
for j in range(M):
    a, b = [int(x) for x in input().split()]
    if H[a - 1] <= H[b - 1]:
        nodes[a - 1] = 0
    if H[b - 1] <= H[a - 1]:
        nodes[b - 1] = 0
print(sum(nodes))

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

N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
mat = np.zeros((N, N), dtype="uint64")
for j in range(M):
    a, b = [int(x) for x in input().split()]
    if mat[a - 1, b - 1] == 0:
        mat[a - 1, b - 1] = H[b - 1]
        mat[b - 1, a - 1] = H[a - 1]

count = 0
for i in range(N):
    h = H[i]
    max_h = np.max(mat[i,:])
    if h > max_h:
        count += 1
print(count)

Fixed submission:
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
nodes = [1 for i in range(N)]
for j in range(M):
    a, b = [int(x) for x in input().split()]
    if H[a - 1] <= H[b - 1]:
        nodes[a - 1] = 0
    if H[b - 1] <= H[a - 1]:
        nodes[b - 1] = 0
print(sum(nodes))

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

N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
mat = np.zeros((N, N))
for j in range(M):
    a, b = [int(x) for x in input().split()]
    if mat[a - 1, b - 1] == 0:
        mat[a - 1, b - 1] = H[b - 1]
        mat[b - 1, a - 1] = H[a - 1]

count = 0
for i in range(N):
    h = H[i]
    max_h = np.max(mat[i,:])
    if h > max_h:
        count += 1
print(count)

Fixed submission:
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
nodes = [1 for i in range(N)]
for j in range(M):
    a, b = [int(x) for x in input().split()]
    if H[a - 1] <= H[b - 1]:
        nodes[a - 1] = 0
    if H[b - 1] <= H[a - 1]:
        nodes[b - 1] = 0
print(sum(nodes))
Buggy python submission (verdict: Runtime Error):
N, M = [int(x) for x in input().split()]
s, c = [], []
ans_array = [None for _ in range(N)]

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for i in range(M):
    if ans_array[s[i] - 1] is None:
        ans_array[s[i] - 1] = c[i]
    else:
        if ans_array[s[i] - 1] != c[i]:
            print(-1)
            exit()

if ans_array[-1] is not None:
    ans_array = [0 if num is None else num for num in ans_array]
elif len(ans_array) == 1:
    print(0)
else:
    print(-1)
    exit()

ans = int("".join([str(num) for num in ans_array]))
print(ans)

Fixed submission:
import math

N, M = [int(x) for x in input().split()]
s, c = [], []

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for num in range(10 ** N):
    num = str(num)
    if len(num) != N:
        continue
    for i in range(M):
        if num[s[i] - 1] != str(c[i]):
            break
    else:
        print(int(num))
        exit()

print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = [int(x) for x in input().split()]
s, c = [], []
ans_array = [0 for _ in range(M)]

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for i in range(M):
    if ans_array[s[i] - 1] == 0:
        ans_array[s[i] - 1] = c[i]
    else:
        if ans_array[s[i] - 1] != c[i]:
            print(-1)
            exit()

ans_num = int("".join([str(num) for num in ans_array]))
if ans_num == 0:
    for num in ans_array[:-1]:
        if num != 0:
            break
    print(-1)
else:
    print(ans_num)

Fixed submission:
import math

N, M = [int(x) for x in input().split()]
s, c = [], []

for i in range(M):
    s_i, c_i = [int(x) for x in input().split()]
    s.append(s_i)
    c.append(c_i)

for num in range(10 ** N):
    num = str(num)
    if len(num) != N:
        continue
    for i in range(M):
        if num[s[i] - 1] != str(c[i]):
            break
    else:
        print(int(num))
        exit()

print(-1)
Buggy python submission (verdict: Runtime Error):
x = int(input())
return x ** 2

Fixed submission:
x = int(input())
print(x ** 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split(" ")]
B = [int(x) for x in input().split(" ")]

count = 0
for i in range(N):
    n_defeat = min(A[i], B[i])
    A[i] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat
    n_defeat = min(A[i + 1], B[i])
    A[i + 1] -= n_defeat
    B[i] -= n_defeat
    count += n_defeat

print(count)

Fixed submission:
import numpy

A, B = [int(x) for x in input().split(" ")]
if (A - B) % 2 == 0:
    print(abs(A + B) // 2)
else:
    print("IMPOSSIBLE")

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

N = int(input())
p = [int(x) for x in input().split(" ")]

sorted_p = sorted(p)
count = 0
for i in range(N):
    if sorted_p[i] != p[i]: count += 1

if count == 0 or count == 2:
    print("YES")
else:
    print("NO")

Fixed submission:
import numpy

A, B = [int(x) for x in input().split(" ")]
if (A - B) % 2 == 0:
    print(abs(A + B) // 2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if x + x = W and y + y == H:
    flag = 1
else:
    flag = 0

print(max_area, flag) 

Fixed submission:
import numpy as np
from fractions import gcd

def lcm(x, y):
    return x * y // gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

Buggy python submission (verdict: Runtime Error):
import numpy as np
from math.fraction import gcd

def lcm(x, y):
    return x * y // gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

Fixed submission:
import numpy as np
from fractions import gcd

def lcm(x, y):
    return x * y // gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

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

def lcm(x, y):
    return x * y // math.gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

Fixed submission:
import numpy as np
from fractions import gcd

def lcm(x, y):
    return x * y // gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

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

def lcm(x, y):
    return x * y // math.gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)

Fixed submission:
import numpy as np
from fractions import gcd

def lcm(x, y):
    return x * y // gcd(x, y)
A, B, C, D = [int(x) for x in input().split(" ")]
n_targets = B - A + 1

n_compC = n_targets - (B // C - (A - 1) // C)
n_compD = n_targets - (B // D - (A - 1) // D)
n_compCandD = n_targets - (B // lcm(C, D) - (A - 1) // lcm(C, D))

print(n_compC + n_compD - n_compCandD)
Buggy python submission (verdict: Runtime Error):
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if x + x = W and y + y == H:
    flag = 1
else:
    flag = 0

print(max_area, flag) 

Fixed submission:
import numpy as np

W, H, x, y = [int(x) for x in input().split(" ")]
max_area =  W * H / 2.0
eps = 1e-6
if x + x == W and y + y == H:
    flag = 1
else:
    flag = 0

print(max_area, flag)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n_ID, n_gates = [int(data) for data in input().split()]
L = np.empty(n_gates, dtype = int)
R = np.empty(n_gates, dtype = int)

for i in range(n_gates):
  L[i], R[i] = [int(data) for data in input().split()]

ID_gate_matrix = np.zeros((n_ID, n_gates))

for j in range(n_gates):
  for i in range(L[j] - 1, R[j]):
    ID_gate_matrix[i][j] = 1

Card_Counter = 0
for i in range(n_ID):
  for j in range(n_gates):
    if ID_gate_matrix[i][j] != 1:
      break
  else:
    Card_Counter += 1

print(Card_Counter)

Fixed submission:
age, cost = [int(x) for x in input().split()]

if age <= 5:
  print(0)
elif age <= 12:
  print(int(cost / 2))
else:
  print(cost)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split(" ")]
L, R = [], []
for i in range(M):
    l, r = [int(x) for x in input().split(" ")]
    L.append(l - 1)
    R.append(r - 1)

pass_key = set([i for i in range(N)])
for i in range(M):
    if len(pass_key) == 0:
        print(0)
        exit(0)
    else:
        pass_key = pass_key & set([ID for ID in range(L[i], R[i] + 1)])

print(len(pass_key))


Fixed submission:
N, M = [int(x) for x in input().split(" ")]
L, R = [], []

for i in range(M):
    l, r = [int(x) for x in input().split(" ")]
    L.append(l - 1)
    R.append(r - 1)

L_max = max(L)
R_min = min(R)

count = R_min - L_max + 1 if R_min - L_max >= 0 else 0
print(count)
Buggy python submission (verdict: Runtime Error):
    A, B = [int(i) for i in input().split()]
     
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)

Fixed submission:
A, B = [int(i) for i in input().split()]
if B % A == 0:
	print(A + B)
else:
	print(B - A)