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

Fixed submission:
N,M = map(int, input().split())
 
if N == M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
if A == B:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A == B:
  print("YES")
else:
  print("NO")
Problem p04029 (python)

Fixed submission:
A = int(input())
sum = 0
for i in range(1,A+1):
	sum += i
print(str(sum))

Buggy submission (verdict: Runtime Error):
A = int(input())
sum = 0
for i in range(1,A+1)
	sum += i
print(str(sum))
Problem p04043 (python)

Fixed submission:
A = input().split()
if A.count('5') == 2 and A.count('7')==1:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input()).split()
if A.count("5") == 2 and A.count("7")==1:
	print("YSE")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input()).split()
if A.count.("5") == 2 and A.count("7")==1:
	print("YSE")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input()).split()
if A.count.("5") == 2 and a.count("7")==1:
	print("YSE")
else:
	print("NO")
Problem p02718 (python)

Fixed submission:
#!/usr/bin/env python3
import sys

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()
    
    if a[m-1]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()
    print(a[m])
    
    if a[m-1]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()

    if a[m]>t/(4*m):
        print("Yes")
    else:
        print("No")

main()

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

def main():
    
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    t=sum(a)
    a.sort()
    a.reverse()

    if a[m]>=t/(4*m):
        print("Yes")
    else:
        print("No")

main()
Problem p02700 (python)

Fixed submission:
buf = input().split()
th = int(buf[0])
ts = int(buf[1])
ah = int(buf[2])
ass = int(buf[3])

while True:
  ah -= ts
  if ah <= 0:
    break
  th -= ass
  if th <= 0:
    break

if ah <= 0:
  print('Yes')
if th <= 0:
  print('No')

Buggy submission (verdict: Runtime Error):
buf = input().split()
th = int(buf[0])
ts = int(buf[1])
ah = int(buf[2])
as = int(buf[3])

while True:
  ah -= ts
  if ah <= 0:
    break
  th -= as
  if th <= 0:
    break

if ah <= 0:
  print('Yes')
if th <= 0:
  print('No')
Problem p02717 (python)

Fixed submission:
a, b, c = input().split()
print(c, a, b)

Buggy submission (verdict: Runtime Error):
a, b, c = intpu().split()
print(c, a, b)
Problem p02719 (python)

Fixed submission:
buf = input().split()
n = int(buf[0])
k = int(buf[1])

c1 = n % k
c2 = -1 * (c1 - k)

print(min([c1, c2]))

Buggy submission (verdict: Runtime Error):
buf = input().split()
n = int(buf[0])
k = int(buf[1])

c1 = n % k
c2 = -1 * (c1 - k)
return min([c1, c2])
Problem p03102 (python)

Fixed submission:
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
ans = 0

for i in range(N):
    A = list(map(int, input().split()))
    tmp = C
    for i, j in zip(A, B):
        tmp += i * j
    if tmp > 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = [int(input()) for i in range(M)]
A = [[int(input()) for i in range(M)] for j in range(N)]
cnt = 0
for i in range(N):
    ans = 0
    for j in range(M):
        ans += A[j][i] * B[j]
    if ans + C > 0:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = [int(input()) for i in range(M)]
A = [[int(input()) for i in range(M)] for j in range(N)]
cnt = 0
for i in range(N):
    ans = 0
    for j in range(M):
        ans += A[i][j] * B[j]
    if ans + C > 0:
        cnt += 1
print(cnt)
Problem p03106 (python)

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

for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
            print(i)
            break

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
table = []

for i in range(min(a, b)):
    if a % i == 0 and b % i == 0:
        table.append(i)
print(table[-k])
Problem p03109 (python)

Fixed submission:
year, month, day = map(int, input().split("/"))
if year <= 2019 and month <= 4 and day <= 30:
    print("Heisei")
else:
    print("TBD")

Buggy submission (verdict: Runtime Error):
y = 0
for i in range(int(input())):
    x,u = input().split()
    y += int(x) if u == "JPY" else float(x)*380000
print(y)

Buggy submission (verdict: Runtime Error):
y, m, d = int(input().split("/"))

if y < 2019:
    print("Heisei")
elif m <= 4 :
    print("Heisei")
else:
    print("TBD")

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

print("Heisei" if S <= 2019/4/30 else "TBD")

Buggy submission (verdict: Runtime Error):
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y)

Buggy submission (verdict: Runtime Error):
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y

Buggy submission (verdict: Runtime Error):
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y)

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0.0
for i in range(N):
    money, tani = input().split()
    money = float(money)
    if tani = "JPY":
        total += money
    else:
        total += money * 380000.0
print("%f"%(total))

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0.0
for i in range(N):
    money, tani = input().split()
    money = float(money)
    if tani = "JPY":
        total += money
    else:
        total += money * 380000.0
print("%.11f"%(total))

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0.0
rate = 380000.0
for i in range(N):
    money, tani = input().split()
    money = float(input())
    if tani = "JPY":
        total += money
    else:
        total += money*rate
print("%.11f"%(total))

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0.0
for i in range(N):
    money, tani = map(input().split())
    money = float(input())
    if tani = "JPY":
        total += money
    else:
        total += money * 380000.0
print("%.11f"%(total))

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(N):
    money, tani = map(input().split())
    money = float(input())
    if tani = "JPY":
        total += money
    else:
        total += money * 380000
print("%f"%(total))

Buggy submission (verdict: Runtime Error):
S = input()
print('Heisei' if S <= 2019/4/30 else 'TBD')
Problem p03110 (python)

Fixed submission:
y=0
for _ in range(int(input())):
    x,u=input().split()
    y+=int(x) if u=="JPY" else float(x)*380000
print(y)

Buggy submission (verdict: Runtime Error):
N = int(input())
money, tanni = input().split()
total = 0
for i in range(N)
    if tanni == "JPY":
        total += int(money)
    else:
        total += float(money) * 380000
print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
money, tanni = input().split()
money = float(money)
total = 0.0
rate = 380000.0
for i in range(N)
    if tanni == "JPY":
        total += money
    else:
        total += money * rate
print("%.11f"%(total))

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(N):
    money, tani = map(input().split())
    money = int(input())
    if tani = "JPY":
        total += money
    else:
        total += money * 380000
print("%d"%(total))
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 b % a == 0
    print(a + b)
else:
    print(b - a)
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
X = [abs(A - (T - h*0.006)) for h in H]
print(X.index(min(X)) + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
*H, = [map(int, input().split())]
min = 10000000
ans = 0
for i in range(N):
    if min > abs(A - T + H[i] * 0.006):
        min = abs(A - T + H[i] * 0.006)
        ans = i
print(ans)
Problem p03264 (python)

Fixed submission:
K=int(input())
print((K//2)*((K+1)//2))

Buggy submission (verdict: Runtime Error):
N = int(input().split())

print((N//2) * (N//2 + N%2)

Buggy submission (verdict: Runtime Error):
N = int(input().split())

print("%d"%((N / 2) * ((N + 1) / 2)))

Buggy submission (verdict: Runtime Error):
N = int(input().split())
ans = 0
if N%2 == 0:
    ans = (N/2) ** 2
else:
    ans = (N/2) ** 2 - 1/4
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input().split())
ans = 0
if N%2 == 0:
    ans = N/2 ** 2
else:
    ans = (N/2 + 1/2) * (N/2 - 1/2)
print(ans)
Problem p03273 (python)

Fixed submission:
h, w = map(int, input().split())
a = [''] * h
for i in range(h):
	a[i] = input()
 
row = [False] * h
col = [False] * w
for i in range(h):
	for j in range(w):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True
 
for i in range(h):
	if row[i]:
		for j in range(w):
			if col[j]:
				print(a[i][j], end = '')
		print()

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
a = [""] * H
for i in range(H):
    a[i] = input()
row = [False] * H
col = [False] * W
for i in range(H):
    for j in range(W):
        if a[i][j] == "#":
            row[i] = True
            col[i] = True
for i in range(H):
    if row[i]:
        for j in range(W):
            if col[j]:
                print(a[i][j], end = "")
        print()
Problem p03285 (python)

Fixed submission:
N = int(input())
for i in range(100):
    for j in range(100):
        if 4 * i + 7 * j == N:
            print("Yes")
            exit(0)
print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(100):
    for j in range(100):
        if 4 * i + 7 * j == n:
            print("Yes")
            exit(0)
print("No")
Problem p03288 (python)

Fixed submission:
a = int(input())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
a = int(input())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else a 
    print("AGC")

Buggy submission (verdict: Runtime Error):
a = int(input().split())
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

Buggy submission (verdict: Runtime Error):
a = int, input().split()
if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")
Problem p03316 (python)

Fixed submission:
N = int(input())
S = sum([int(n) for n in str(N)])
if N % S == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()
N = int(input())
if N % sum(S) == 0:
    print("Yes")
else:
    print("No")
Problem p03385 (python)

Fixed submission:
print("Yes" if set(list(input())) == set(["a","b","c"]) else "No")

Buggy submission (verdict: Runtime Error):
S = input()
if S = "abc" or S = "acb" or S = "bac" or S = "bca" or S = "cab" or S = "cba":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = list(input())
if S = "abc" or S = "acb" or S = "bac" or S = "bca" or S = "cab" or S = "cba":
    print("Yes")
else:
    print("No")
Problem p02909 (python)

Fixed submission:
input = input()

if input == "Sunny":
	print("Cloudy")
elif input == "Cloudy":
	print("Rainy")
elif input == "Rainy":
	print("Sunny")
else:
	print("Invalid value")

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = []
for X in input().split():
	x = int(X)
	A.append(x)

for x in range(M):
	max = A.index(max(A))
	A[max] = A[max] / 2

sum = 0
for x in range(len(A)):
	sum += int(A[x])

print(sum)
Problem p02918 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(input())
 
p = 0
while K > 0 and p < len(S):
	now = S[p]
	p += 1
	if p >= len(S):
		break
	while now == S[p]:
		p += 1
		if p >= len(S):
			break
			
	if p >= len(S):
		break
	q = p + 1
	if q >= len(S):
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		break
	while S[p] == S[q]:
		q += 1
		if q >= len(S):
			break
	while p < q:
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		p += 1
		if p >= len(S):
			break
	K -= 1
 
ret = 0;
for x in range(len(S)-1):
	if S[x] == S[x + 1]:
		ret += 1
print(ret)

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

p = 0
while K > 0 and p < len(S):
	now = S[p]
	p += 1
	if p >= len(S):
		break
	while now == S[p]:
		p += 1
		if p >= len(S):
			break

	q = p + 1
	if q >= len(S):
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		break
	while S[p] == S[q]:
		q += 1
		if q >= len(S):
			break
	while p < q:
		if S[p] == "R":
			S[p] = "L"
		else:
			S[p] = "R"
		p += 1
		if p >= len(S):
			break
	K -= 1

ret = 0;
for x in range(len(S)-1):
	if S[x] == S[x + 1]:
		ret += 1
print(ret)
Problem p03219 (python)

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

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

Fixed submission:
A, B, C, D = map(int, input().split())
 
flg = True
t = False
while(flg):
  C -= B
  if (C <= 0):
    t = True
    break
  A -= D
  if (A <= 0) :
    t = False
    break

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

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
 
flg = true
t = false
while(flg):
  t = true
  C -= B
  if (C <= 0):
    break
  t = false
  A -= D
  if (A <= 0) :
    break

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

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
 
flg = true
t = false
while(flg):
  t = true
  C -= B
  if (C <= 0):
    break
  t = false
  D -= B
  if (D <= 0) :
    break

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

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

flg = true
t = false
while(flg):
  t = true
  D -= B
  if (D <= 0):
    break
  t = false
  A -= C
  if (A <= 0) :
    break

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

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

x = C / B
y = C % B
p = A / D
q = A % D

if (y <> 0):
  x += 1
if (q <> 0):
  p += 1

if (x <= p):
  print("Yes")
elif (x > p):
  print("No")

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

x = C / B
y = C % B
p = A / D
q = A % D

if (x > p):
  print("Yes")
elif (x < p):
  print("No")
else
  if (y == 0 and q <> 0):
    print("Yes")
  elif (y <> 0 and q == 0):
    print("No")
  else :
    print("Yes")

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

x = C / B
y = C % B
p = A / D
q = A % D

if (x < p):
  print("Yes")
elif (x > p):
  print("No")
else
  if (y == 0 and q <> 0):
    print("Yes")
  elif (y <> 0 and q == 0):
    print("No")
  else :
    print("Yes")

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

x = C / B
y = C % B
p = A / D
q = A % D

if (x > p):
  print("Yes")
elif (x < p):
  print("No")
else
  if (y == 0 and q <> 0):
    print("Yes")
  elif (y <> 0 and q == 0):
    print("No")
  else :
    print("Yes")

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

x = C / B
y = C % B
p = A / D
q = A % D

if (x < p):
  print("Yes")
elif (x > p):
  print("No")
else
  if (y == 0):
    print("Yes")
  elif (y <> 0 and q == 0):
    print("No")
  else :
    print("Yes")

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

x = A / D
y = A % D
p = C / B
q = C % B

if (p < x):
  print("Yes")
elif (p == x):
  if (y == 0 and q <> 0):
    print("No")
  else:
    print("Yes")
else:
  print("No")
Problem p02700 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
takahashi = [a, b]
aoki = [c, d]
attackers = [takahashi, aoki]
attacker = 0

while attackers[0][0]!=0 and attackers[1][0]!=0:
  attackers[attacker^1][0] = max(0, attackers[attacker^1][0]-attackers[attacker][1])
  attacker = attacker^1

if attackers[0][0]==0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
takahashi = [a, b] if a>b else [b, a]
aoki = [c, d] if c>d else [d, c]
attackers = [takahashi, aoki]
attacker = 0

while 0 not in takahashi and 0 not in aoki:
  attackers[attacker^1][1] = max(0, attackers[attacker^1][1]-attackers[attacker][0])
  attackers[attacker^1].sort(reversed=True)
  attacker = attacker^1

if 0 in attackers[0]:
  print('No')
else:
  print('Yes')
Problem p02958 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
c = list(filter(lambda i: a[i]!=b[i], range(n)))
print('YES' if len(c) in [0,2] else 'NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
b = a.sorted()
c = list(filter(a[i]!=b[i], range(len(a)))
print('YES' if len(c)==2 else 'NO')
Problem p02993 (python)

Fixed submission:
s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(b - a - c_n - d_n + l_n + 1)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(b - a - c_n - d_n + l_n + 1)

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(b - a - c_n - d_n + l_n + 1)

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d = map(int, input().split())
c_n = b//c - (a-1)//c
d_n = b//d - (a-1)//d
l = (c*d)//gcd(c,d)
l_n = b//l - (a-1)//l
print(c_n+d_n-l_n)
Problem p03005 (python)

Fixed submission:
n , k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list()
for _ in range(n):
    a.append(list(map(int, input().split())))
if n in [1,2]:
    print(1)
else:
    a.sort()
    diff = list()
    for i in range(len(a) - 1):
        for j in range(i+1, len(a)):
            x = a[j][0]-a[i][0]
            y = a[j][1]-a[i][1]
            if x<0 and y<0:
                z = (-x,-y)
            elif x<0 and y>0:
                z = (-x,-y)
            else:
                z = (x,y)
            diff.append(z)
    t_diff = Counter(diff).most_common(1)[0][1]
    print(n-t_diff)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = list()
for _ in range(n):
    a.append(list(map(int, input().split())))
if n in [1,2]:
    print(1)
else:
  a.sort()
    diff = list()
    for i in range(len(a) - 1):
        for j in range(i+1, len(a)):
            x = a[j][0]-a[i][0]
            y = a[j][1]-a[i][1]
            if x<0 and y<0:
                z = (-x,-y)
            elif x<0 and y>0:
                z = (-x,-y)
            else:
                z = (x,y)
            diff.append(z)
    t_diff = Counter(diff).most_common(1)[0][1]
    print(n-t_diff)
Problem p02924 (python)

Fixed submission:
n = int(input())

print((n * (n - 1)) // 2)

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

def kaidan(n):
    if n <= 1:
        return 0
    else:
        return n - 1 + kaidan(n - 1)

print(kaidan(n))
Problem p03891 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
print(a,b,-a-b+3*c)
print(-2*a-b+4*c,c,2*a+b-2*c)
print(a+b-c,-b+2*c,-a+2*c)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(a,b,c)
print(a,b,-a-b+3*c)
print(-2*a-b+4*c,c,2*a+b-2*c)
print(a+b-c,-b+2*c,-a+2*c)
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
print(r*2*math.pi)

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

x = [0]*n
j = 0
for i in range(n):
    k = 1
    while j < n-1:
        if i+1 == a[j]:
            j+=1
            k+=1
        else:
            break
    x[i] = k

ans = [print(_) for _ in x]
Problem p02814 (python)

Fixed submission:
from math import *
from fractions import *
from sys import stdout, stderr, version_info
def fprintf(fs, s, *argv):
    fs.write(s.format(*argv))

def printf(s, *argv):
    fprintf(stdout, s, *argv)

if version_info[0] == 2:
    input = raw_input

def gets(type=int, sep=' '):
    return map(type, input().split(sep))

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

def num2(a):
    cnt = 0
    while(a % 2 == 0):
        cnt += 1
        a /= 2
    return cnt

def main():
    n,m = gets()
    a = gets()
    lcm = 1
    cnt2 = -1
    for ai in a:
        lcm = _lcm(lcm,ai)
        n2 = num2(ai)
        if (cnt2 != -1 and cnt2 != n2):
            printf('0\n');
            return
        cnt2 = n2

    fprintf(stderr, 'lcm: {}\n', lcm)

    lo, hi = -1, m+1
    while (lo+1 < hi):
        mid = (lo+hi)//2
        if ((mid*2+1) * lcm//2 <= m):
            lo = mid
        else:
            hi = mid

    printf('{}\n', hi)

main()

Buggy submission (verdict: Runtime Error):
from sys import stdout, stderr
def fprintf(fs, s, *argv):
    fs.write(s.format(*argv))

def printf(s, *argv):
    fprintf(stdout, s, *argv)

from math import *

def gets(type=int, sep=' '):
    return map(type, input().split(sep))

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

def num2(a):
    cnt = 0
    while(a % 2 == 0):
        cnt += 1
        a /= 2
    return cnt

def main():
    n,m = gets()
    a = gets()
    lcm = 1
    cnt2 = -1
    for ai in a:
        lcm = _lcm(lcm,ai)
        n2 = num2(ai)
        if (cnt2 != -1 and cnt2 != n2):
            printf('0\n');
            return
        cnt2 = n2

    fprintf(stderr, 'lcm: {}\n', lcm)

    lo, hi = -1, m+1
    while (lo+1 < hi):
        mid = (lo+hi)//2
        if ((mid*2+1) * lcm//2 <= m):
            lo = mid
        else:
            hi = mid

    printf('{}\n', hi)

main()
Problem p03282 (python)

Fixed submission:
# coding: utf-8

s,k = [ input() for i in range(2) ]

count = 0
while count != len(s) and s[count]=="1":
    count += 1

if int(k) <= count:
    print(1)
else:
    print(s[count])

Buggy submission (verdict: Runtime Error):
# coding: utf-8

s,k = [ input() for i in range(2) ]

count = 0
while s[count]=="1":
    count += 1

if int(k) <= count:
    print(1)
else:
    print(s[count])
Problem p03625 (python)

Fixed submission:
n = int(input())
l = sorted((int(x) for x in input().split()), reverse = True)
a = []
t = None
for x in l:
  if t == x:
    t = None
    a.append(x)
    if len(a) > 1:
      break
  else:
    t = x
print(a[0]*a[1] if len(a) > 1 else 0)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [int(x) for x in input().split()]
x = max(i for i in set(l) if l.count(i)>1)
if l.count(x) > 3:
  print(x*x)
else:
  y = max(i for i in set(l)-{x} if l.count(i) > 1)
  print(y*x)