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

Fixed submission:
H, W = map(int, input().split(' '))
matrix = []
for _ in range(H):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

flag = 'Yes'
for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) and (i < H - 1 and matrix[i+1][j] == 0):
                    flag = 'No'
                    break

print(flag)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split(' '))
matrix = []
for _ in range(W):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

flag = 'Yes'
for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        if s == 1:
            if j > 0 and row[j-1] == 0:
                if j < W - 1 and row[j+1] == 0:
                    if i > 0 and matrix[i-1][j] == 0:
                        if i < H - 1 and matrix[i+1][j] == 0:
                            flag = 'No'
                            break

print(flag)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split(' '))
matrix = []
for _ in range(W):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

flag = 'Yes'
for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) and (i < H - 1 and matrix[i+1][j] == 0):
                    flag = 'No'
        if flag == 'No':
            break

print(flag)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

H, W = map(int, input().split(' '))
matrix = []
for _ in range(W):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        flag = True
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) and (i < H - 1 and matrix[i+1][j] == 0):
                    print('No')
                    exit(0)

print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split(' '))
matrix = []
for _ in range(W):
    tmp = [0 if j == '.' else 1 for j in input()]
    matrix.append(tmp)

for i, row in enumerate(matrix):
    for j, s in enumerate(row):
        flag = True
        if s == 1:
            if (j > 0 and row[j-1] == 0) and (j < W - 1 and row[j+1] == 0):
                if (i > 0 and matrix[i-1][j] == 0) or (i < H - 1 and matrix[i+1][j] == 0):
                  exit(0)

print('Yes')
Problem p03369 (python)

Fixed submission:
S = input()
ans = 700 + S.count('o') * 100
print(ans)

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

if A + B > 2 * C:
    if A < B:
        ans = 2 * C * Y + min(A, 2 * C) * max((X - Y), 0)
    else:
        ans = 2 * C * X + min(B, 2 * C) * max((Y - X), 0)
else:
    ans = A * X + B * Y

print(ans)
Problem p03385 (python)

Fixed submission:
S = sorted(input())
if S[0] == 'a' and S[1] == 'b' and S[2] == 'c': print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
print('Yes' len(set(input())) == 3 else 'No')
Problem p03611 (python)

Fixed submission:
import sys

def main():
    N = int(sys.stdin.readline())
    a = list(map(int, input().split()))
    n = [0 for i in range(0, max(a)+1)]
    for i in a:
        n[i] += 1
    if len(n) < 3:
        print(sum(n))
    else:
        print(max([i+j+k for i, j, k in zip(n[:-2], n[1:-1], n[2:])]))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(sys.stdin.readline())
    a = list(map(int, input().split()))
    n = [0 for i in range(0, max(a)+1)]
    for i in a:
        n[i] += 1
    if len(a) < 2:
        print(sum(n))
    else:
        print(max([i+j+k for i, j, k in zip(n[:-2], n[1:-1], n[2:])]))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(sys.stdin.readline())
    a = list(map(int, input().split()))
    n = [0 for i in range(0, max(a)+1)]
    for i in a:
        n[i] += 1
    print(max([i+j+k for i, j, k in zip(n[:-2], n[1:-1], n[2:])]))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N = int(sys.stdin.readline())
    a = list(map(int, input().split()))
    n = [0 for i in range(0, max(a)+1)]
    for i in a:
        n[i] += 1
    print(max([i+j+k for i, j, k in zip(n, n[1:], n[2:])]))

if __name__ == '__main__':
    main()
Problem p03612 (python)

Fixed submission:
import sys

def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            count += 1
            if len(p) != i:
                p[i - 1], p[i] = p[i], p[i - 1]
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
              	count += 1
                p[i - 1], p[i] = p[i], p[i - 1]
            except:
                break
    print(count)
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if len(p) == i:
            continue
        if i == n:
            p[i - 1], p[i] = p[i], p[i - 1]
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i - 1], p[i] = p[i], p[i - 1]
                count += 1
            except:
                break
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i], p[i] = p[i], p[i - 1]
                count += 1
            except:
                break
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i], p[i] = p[i], p[i - 1]
                count += 1
        	except:
          		break
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            try:
                p[i], p[i] = p[i], p[i - 1]
                count += 1
        except:
            break
    print(count)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(sys.stdin.readline())
    p = list(map(int, input().split()))
    count = 0
    for i, n in enumerate(p, 1):
        if i == n:
            p[i - 1], p[i] = p[i], p[i - 1]
            count += 1
    print(count)

if __name__ == '__main__':
    main()
Problem p03633 (python)

Fixed submission:
def gcd(a, b):
    if a < b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return (a * b) // gcd(a, b)

N = int(input())
T = [int(input()) for i in range(N)]

ans = T[0]

for t in T[1:]:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if a < b:
        a, b = b ,a
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return int((a * b) / gcd(a, b))

N = int(input())
T = [int(input()) for i in range(N)]

ans = T[0]

for t in T[1:]:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return int((a * b) / gcd(a, b))

N = int(input())
T = [int(input()) for i in range(N)]

ans = T[0]

for t in T[1:]:
    ans = lcm(ans, t)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return int((a * b) / gcd(a, b))

N = int(input())
T = [int(input()) for i in range(N)]

ans = T[0]

for t in T[1:]:
    ans = lcm(t, ans)

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return int((a * b) / gcd(a, b))

N = int(input())
T = [int(input()) for i in range(N)]

a = T[0]

for b in T[1:]:
    a = lcm(a, b)

print(a)
Problem p03643 (python)

Fixed submission:
N = raw_input()
print('ABC{0}'.format(N))

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
    if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) != 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
    if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
flag = True
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
    if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
Problem p03645 (python)

Fixed submission:
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
    if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
    if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) != 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
flag = True
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
     if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = []
for tag in list1:
    matched_list+=filter(lambda str: str == tag, nlist)
if len(matched_list) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')

Buggy submission (verdict: Runtime Error):
import sys
l = raw_input().split()
N = int(l[0])
M = int(l[1])
nlist = []
list1 = []
flag = True
for i in range(0, M):
    tmp = raw_input().split()
    a = int(tmp[0])
    b = int(tmp[1])
     if a == 1:
        list1.append(b)
        continue
    if b == N:
        nlist.append(a)
        continue
matched_list = list(set(list1) & set(nlist))
if len(matched_list) == 0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
Problem p03673 (python)

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

b = [0 for _ in range(n)]
i = 0
j = n - 1

while(j >= 0):
    b[i] = a[j]
    i += 1
    j -= 2

j = 0 if j == -1 else 1

while(i < n):
    b[i] = a[j]
    i += 1
    j += 2

ans = ' '.join(map(str, b))
print(ans)

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

b = [0 for _ in range(n)]

i = 0
j = n - 1

while(j > 0):
    b[i] = a[j]
    i += 1
    j -= 2

j = 1 if j == 0 else 0

while(i < n):
    b[i] = a[j]
    i += 1
    j += 2

ans = ' '.join(map(str, b))
print(ans)
Problem p03945 (python)

Fixed submission:
S = input()

s = S[0]
if len(S) > 1:
    for i in S[1:]:
        if i != s[-1]:
            s += i

print(len(s) - 1)

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

s = ''
for i in S:
    if i != s[-1]:
        s += i

print(len(s) - 1)
Problem p03455 (python)

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

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

N, K = map(int, input().split())
ub = K * 2
bw = {"B": np.zeros((ub, ub), int), "W": np.zeros((ub, ub), int)}
for i in range(N):
	x, y, c = input().split()
	bw[c][int(x) % ub][int(y) % ub] += 1

def accum_arr(arr):
	acc_h = np.zeros((ub, ub), int)
	acc_v = np.zeros((ub, ub), int)
	acc = np.zeros((ub, ub), int)
	acc_h[:, 0] = arr[:, 0] + arr[:, - (K - 1):].sum(axis=1)
	acc_v[0, :] = arr[0, :] + arr[- (K - 1):, :].sum(axis=0)

	for i in range(1, ub):
		acc_h[:, i] = arr[:, i] + acc_h[:, i - 1] - arr[:, (i - K) % ub]
		acc_v[i, :] = arr[i, :] + acc_v[i - 1, :] - arr[(i - K) % ub, :]

	acc[0][0] = arr[0][0] + arr[0, - (K - 1):].sum() + arr[- (K - 1):, 0].sum() + arr[-(K - 1):, - (K - 1):].sum()

	for j in range(1, ub):
		acc[0][j] = acc[0][j - 1] + acc_v[0][j] - acc_v[0][(j - K) % ub]

	for j in range(ub):
		for i in range(1, ub):
			acc[i][j] = acc[i - 1][j] + acc_h[i][j] - acc_h[(i - K) % ub][j]

	return acc


b_acc = accum_arr(bw["B"])
w_acc = accum_arr(bw["W"])

ans = 0
for x in range(ub):
	for y in range(ub):
		x_cmp = (x + K) % ub
		y_cmp = (y + K) % ub
		tmp_ans = b_acc[x][y] + b_acc[x_cmp][y_cmp] + w_acc[x][y_cmp] + w_acc[x_cmp][y]
		if tmp_ans > ans:
			ans = tmp_ans

print(ans)
Problem p03469 (python)

Fixed submission:
S = list(input())
S[3] = "8"
print("".join(S))

Buggy submission (verdict: Runtime Error):
S = list(input())
S[3] = "8"
print("".join(S))
Problem p03544 (python)

Fixed submission:
N = int(input())
l_im2, l_im1, l_i = 2, 1, 1
for i in range(2, N + 1):
	l_i = l_im1 + l_im2
	l_im1, l_im2 = l_i, l_im1
print(l_i)

Buggy submission (verdict: Runtime Error):
N = int(input())
l_im2, l_im1 = 2, 1
for i in range(2, N + 1):
	l_i = l_im1 + l_im2
	l_im1, l_im2 = l_i, l_im1
print(l_i)
Problem p03547 (python)

Fixed submission:
import numpy as np
ans = ["<", "=", ">"]
m = np.full((6, 6), 1, np.int64)
m[np.tri(6) == 0] = 0
m[np.tri(6).T == 0] = 2
X, Y = map(lambda x: ord(x) - 65, input().split())
print(ans[m[X][Y]])

Buggy submission (verdict: Runtime Error):
import numpy as np
ans = ["<", "=", ">"]
m = np.full((6, 6), 1, mp.int64)
m[np.tri(6) == 0] = 2
m[np.tri(6).T == 0] = 0
X, Y = map(lambda x: ord(x) - 65, input().split())
print(ans[m[X][Y]])

Buggy submission (verdict: Runtime Error):
import numpy as np
ans = np.full((6, 6), "=")
ans[np.tri(6) == 0] = "<"
ans[np.tri(6).T == 0] = ">"
X, Y = map(lambda x: ord(x) - 65, input().split())
print(ans[X][Y])
Problem p03573 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A == B:
	print(C)
elif B == C:
	print(A)
else:
	print(B)

Buggy submission (verdict: Runtime Error):
from itertools import combinations as comb
import numpy as np
N, K = map(int, input().split())
ans = 10 ** 18 + 1
choice = min(K, 4)
ps = np.array([list(map(int, input().split())) for i in range(N)])
for idxs in comb(range(N), choice):
	rep_ps = ps[idxs, :]
	x_max = rep_ps[:, 0].max()
	y_max = rep_ps[:, 1].max()
	x_min = rep_ps[:, 0].min()
	y_min = rep_ps[:, 1].min()
	in_num = sum((ps[:, 0] <= x_max) & (ps[:, 0] >= x_min) & (ps[:, 1] <= y_max) & (ps[:, 1] >= y_min))
	area = (y_max - y_min) * (x_max - x_min)
	if K >= in_num and area < ans:
		ans = area
print(area)
Problem p03576 (python)

Fixed submission:
from itertools import combinations as comb
N, K = map(int, input().split())
ans = (2 * 10 ** 9) ** 2 + 1
choice = min(K, 4)
xs = [0] * N
ys = [0] * N
for i in range(N):
	xs[i], ys[i] = map(int, input().split())

for idxs in comb(range(N), choice):
	x_mx = y_mx = - 10 ** 9
	x_mn = y_mn = 10 ** 9
	for i in idxs:
		x_mx = max(x_mx, xs[i])
		y_mx = max(y_mx, ys[i])
		x_mn = min(x_mn, xs[i])
		y_mn = min(y_mn, ys[i])
	in_num = sum(x_mn <= xs[i] <= x_mx and y_mn <= ys[i] <= y_mx for i in range(N))
	area = (x_mx - x_mn) * (y_mx - y_mn)
	if in_num >= K and area < ans:
		ans = area
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations as comb
import numpy as np
N, K = map(int, input().split())
ans = 10 ** 18 + 1
choice = min(K, 4)
ps = np.array([list(map(int, input().split())) for i in range(N)])
for idxs in comb(range(N), choice):
	rep_ps = ps[idxs, :]
	x_max = rep_ps[:, 0].max()
	y_max = rep_ps[:, 1].max()
	x_min = rep_ps[:, 0].min()
	y_min = rep_ps[:, 1].min()
	in_num = sum((ps[:, 0] <= x_max) & (ps[:, 0] >= x_min) & (ps[:, 1] <= y_max) & (ps[:, 1] >= y_min))
	area = (y_max - y_min) * (x_max - x_min)
	if K >= in_num and area < ans:
		ans = area
print(area)
Problem p04001 (python)

Fixed submission:
from itertools import permutations as perm
S = raw_input()
n = len(S)
dp = [[] for i in xrange(n)]
dp[0].append(int(S[0]))
for i in xrange(1,n):
	dp[i].append(int(S[:i+1]))
	for j in xrange(i):
		for k in dp[j]:
			dp[i].append(k+int(S[j+1:i+1]))
print sum(dp[n-1])

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import product
from sys import stdin
def gen_b(x,B):
	if x < 3: lb = 2
	else: lb = x - 1
	if x > B-2: ub = B-1
	else: ub = x + 1
	return xrange(lb,ub+1)
def solve():
	count = defaultdict(int)
	ans = [0]*10
	L = map(lambda x:map(int,x.split()),stdin.readlines())
	H,W,N = L[0]
	for i in xrange(1,N+1):
		for x,y in product(gen_b(L[i][0],H),gen_b(L[i][1],W)):
			count[x+(y<<34)] += 1
	for v in count.itervalues():ans[v] += 1
	ans[0] = (H-2)*(W-2) - sum(ans[1:])
	for c in ans: print c
solve()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from sys import stdin
def gen_bound(x,B):
	if x < 3: lb = 2
	else: lb = x - 1
	if x > B-2: ub = B-1
	else: ub = x + 1
	return lb,ub+1
def solve():
	count = defaultdict(int)
	ans = [0]*10
	L = map(lambda x:map(int,x.split()),stdin.readlines())
	H,W,N = L[0]
	for i in xrange(1,N+1):
		xlb,xub = gen_bound(L[i][0],H)
		ylb,yub = gen_bound(L[i][1],W)
		for x in xrange(xlb,xub):
			for y in xrange(ylb,yub):
				count[x+(y<<34)] += 1
	for v in count.itervalues():ans[v] += 1
	ans[0] = (H-2)*(W-2) - sum(ans[1:])
	for c in ans: print c
solve()
Problem p04026 (python)

Fixed submission:
from collections import deque
S = [ord(a)-97 for a in raw_input()]
N = len(S)
for c in xrange(26):
	L = deque()
	for i in xrange(N-1):
		if S[i] == c:
			l = i
			break
	else:
		continue
	cnt = 1
	lenL = 0
	for r in xrange(l+1,N):
		if S[r] == c:
			cnt += 1
			L.append(r)
			lenL += 1
			if cnt * 2 > r - l + 1:
				print l+1,r+1
				quit()
		while cnt * 2 < r - l + 1 and lenL > 0:
			l = L.popleft()
			lenL -= 1
			cnt -= 1
print -1,-1

Buggy submission (verdict: Runtime Error):
from collections import deque
S = [ord(a)-97 for a in raw_input()]
N = len(S)
for c in xrange(26):
	ls = deque()
	for i in xrange(N-1):
		if S[i] == c:
			l = i
			break
	else:
		continue
	cnt = 1
	for r in xrange(l+1,N):
		if S[r] == c:
			cnt += 1
			ls.append(r)
			if cnt * 2 > r - l + 1:
				print l+1,r+1
				quit()
		else:
			if cnt * 2 < r - l + 1:
				l = ls.popleft()
				cnt -= 1
print -1,-1
Problem p03632 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c, d = map(int, input().split())
if(c < b):
    if(d <= b):
        if(d <= a):
            time = 0
        elif(c < a):
            time = d - a
        else:
            time = d - c
    elif (c < a):
        time = b - a
    else:
        time = b - c
else:
    time = 0
print(time)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b, c, d = map(int, input().split())
if(c < b):
    if(d <= b):
        if(d <= a):
            time = 0
        else if(c < a):
            time = d - a
        else:
            time = d - c
    else:
        time = b - c
else:
    time = 0
print(time)
Problem p02768 (python)

Fixed submission:
# from .myutil import Combination
from math import factorial

MOD = 10 ** 9 + 7
def Combination2(n, r):
    ret = 1
    for i in range(r):
        ret = ret * (n - i) % MOD
    return ret * pow(factorial(r), MOD - 2, MOD) % MOD

n, a, b = map(int, input().split())

total = pow(2, n, MOD) - Combination2(n, a) - Combination2(n, b) - 1
total %= MOD

print(total)

Buggy submission (verdict: Runtime Error):
# from .myutil import Combination


class Combination:
    mod = 0
    N = 0
    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]

    def __init__(self, mod=10 ** 9 + 7, N=10 ** 6):
        self.mod = mod
        self.N = N
        for i in range(2, self.N + 1):
            self.g1.append((self.g1[-1] * i) % self.mod)
            self.inverse.append((-self.inverse[self.mod % i] * (self.mod // i)) % self.mod)
            self.g2.append((self.g2[-1] * self.inverse[-1]) % self.mod)

    def cmb(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.mod


n, a, b = map(int, input().split())
comb = Combination()

total = (2 ** n) - comb.cmb(n, a) - comb.cmb(n, b) - 1

print(total)
Problem p03059 (python)

Fixed submission:
input = input()
sp_input = input.split(" ")
A = int(sp_input[0])
B = int(sp_input[1])
T = int(sp_input[2]) + 0.5
a = A

ret = 0
i = B
while a <= T:
  ret += B
  a += A

print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = [int(n) for n in input().split(" ")]
C = [int(n) for n in input().split(" ")]
ret = 0
for i in range(N):
    if V[i] - C[i] > 0:
        ret += V[i] - C[i]

print(ret)
Problem p03125 (python)

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

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

if A % B == 0:
  print(A+B)
else:
  print(B-A)
Problem p03129 (python)

Fixed submission:
N, K = map(int, input().split())
if N%2 == 1:
    N += 1
cnt = int(N/2)
if cnt >= K:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, input().split())
if A + 2 > B:
    print(K+1)
    exit()


bis = 0
K = K - (A+1)
bis = B

if B - A >= 2:
    if K > 1:
        k = K//2
        bis += (B-A)*k

    if K % 2 == 1:
        bis += 1

print(bis)
Problem p03493 (python)

Fixed submission:
s1s2s3 = input()

s = str(s1s2s3)
count = 0

for i in range(3):
    if int(s[i]) == 1:
        count +=1

print(count)

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

N = int(input())
num = list(map(int, input().split()))
num = np.array(num)
count = 0
judge = 0

for i in range(N):
    if (num[i] % 2) == 1:
        judge = 1

while judge == 0:

    num = num/2
    count += 1

    for i in range(N):
        if (num[i] % 2) == 1:
            judge = 1

print(count)