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

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
ans = 0

for i in range(n-2):
    ans += min(b[i],b[i+1])  

print(ans+b[-1]+b[0])

Buggy submission (verdict: Runtime Error):
import copy
n = int(input())
b = list(map(int,input().split()))
ans = 0
ls = copy.copy(b)

for i in range(n-1):
    if b[i] == 0:
        ls.remove(0)
        if i+1 < n-1:
            ls.remove(b[i+1])  

if n == 2:
    print(min(b)*2)
else:
    print(sum(ls)+min(ls))

Buggy submission (verdict: Runtime Error):
import copy
n = int(input())
b = list(map(int,input().split()))
ans = 0
ls = copy.copy(b)

for i in range(n-1):
    if i > (n-2):
        break
    if b[i] == 0:
        ls.remove(0)
        ans -= b[i+1]
    else:
        ans += b[i]

if n == 2:
    print(min(b)*2)
else:
    print(ans+min(ls))
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
ans = 0
ls = []
for i in range(n-1):
    if h[i] >= h[i+1]:
        ans += 1
    else:
        ls.append(ans)
        ans = 0
ls.append(ans)
print(max(ls))
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
c = 0
t = 0
for i in range(len(h)-2):
    if h[i+2]<h[i+1]<h[i] or h[i+1]-h[i] <= -2:
        print("No")
        c += 1
        break
    if h[i+1]<h[i]:
        t += 1
        if t == 2:
            print("No")
            c += 1
            break
    elif h[i+1]>h[i]:
        t = 0
    
            
if c == 0:
    if len(h)>=2:
        if h[-1]-h[-2] <= -2:
            print("No")
        else:
            print("Yes")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 0
for i in range(len(h)-2):
    if h[i+2]<h[i+1]<h[i] or h[i+1]-h[i] < -2:
        print("No")
        c += 1
        break
        
if c == 0:
    if h[-1]-h[-2] < -2:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 0
for i in range(len(h)-2):
    if h[i+2]<h[i+1]<h[i] or h[i+1]-h[i] >= 3:
        print("No")
        c += 1
        break
        
if c == 0:
    if h[-1]-h[-2] >= 3:
        print("No")
    else:
        print("Yes")
Problem p02975 (python)

Fixed submission:
n=int(input())
al=list(map(int,input().split()))
t=0
for a in al:
    t^=a
print('Yes' if t==0 else 'No')

Buggy submission (verdict: Runtime Error):
import copy
n = int(input())
a = list(map(int,input().split()))
a2 = copy.copy(a)
c = 0
d = len(a)
for i in range(len(a)):
    if i+1 == len(a):
        ans = a[i-1] ^ a[0]
        if (ans in a2):
            try:
                a2.remove(ans)
            except e:
                break
        else:
            break
    else:
        ans = a[i-1] ^ a[i+1]
        if (ans in a2):
            try:
                a2.remove(ans)
            except e:
                break
        else:
            break
    c += 1
    print(a2)

if c == d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import copy
n = int(input())
a = list(map(int,input().split()))
a2 = copy.copy(a)
c = 0
d = len(a)
for i in range(len(a)):
    if i+1 == len(a):
        ans = a[i-1] ^ a[0]
        if (ans in a):
            try:
                a2.remove(ans)
            except e:
                break
        else:
            break
    else:
        ans = a[i-1] ^ a[i+1]
        if (ans in a):
            try:
                a2.remove(ans)
            except e:
                break
        else:
            break
    c += 1

if c == d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import copy
n = int(input())
a = list(map(int,input().split()))
a2 = copy.copy(a)
c = 0
d = len(a)
for i in range(len(a)):
    if i+1 == len(a):
        ans = a[i-1] ^ a[0]
        if (ans in a):
            a2.remove(ans)
        else:
            break
    else:
        ans = a[i-1] ^ a[i+1]
        if (ans in a):
            a2.remove(ans)
        else:
            break
    c += 1

if c == d:
    print("Yes")
else:
    print("No")
Problem p02993 (python)

Fixed submission:
s = list(input())
count = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        count += 1

if count > 0:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
from fractions import gcd
import math
a,b,c,d = map(int,input().split())
 
an1 = math.floor(b/c)
an2 = math.floor((a-1)/c)
an3 = math.floor(b/d)
an4 = math.floor((a-1)/d)
 
gcd = round(c * d / gcd(c, d))
 
an5 = math.floor(b/gcd)
an6 = math.floor((a-1)/gcd)
an = an1-an2 + an3-an4 -(an5-an6)
print((b-a+1)-an)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
import math
a,b,c,d = map(int,input().split())


an1 = math.floor(b/c)
an2 = math.floor((a-1)/c)
an3 = math.floor(b/d)
an4 = math.floor((a-1)/d)

gcd = round(c * d / gcd(c, d))

an5 = math.floor(b/gcd)
an6 = math.floor((a-1)/gcd)
an = an1-an2 + an3-an4 -(an5-an6)
print((b-a+1)-an)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
import math
a,b,c,d = map(int,input().split())

if c == 1 or d == 1:
    print(0)
elif a == b:
    if a%c == 0 or a%d == 0:
        print(0)
    else:
        print(1)
else:
    an1 = (b//c)
    an2 = ((a-1)//c)
    an3 = (b//d)
    an4 = ((a-1)//d) 
    gcd = round(c * d / gcd(c, d))
    an5 = (b//gcd)
    an6 = ((a-1)//gcd)
    if c == d:
        an = an1-an2
    else:
        an = an1-an2 + an3-an4 -(an5-an6)
    print((b-a+1)-an)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
a,b,c,d = map(int,input().split())

if c == 1 or d == 1:
    print(0)
else:
    an1 = math.floor(b/c)
    an2 = math.floor((a-1)/c)
    an3 = math.floor(b/d)
    an4 = math.floor((a-1)/d) 
    gcd = round(c * d / gcd(c, d))
    an5 = math.floor(b/gcd)
    an6 = math.floor((a-1)/gcd)
    an = an1-an2 + an3-an4 -(an5-an6)
    print((b-a+1)-an)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())


an1 = math.floor(b/c)
an2 = math.floor((a-1)/c)
an3 = math.floor(b/d)
an4 = math.floor((a-1)/d)

gcd = round(c * d / math.gcd(c, d))

an5 = math.floor(b/gcd)
an6 = math.floor((a-1)/gcd)
an = an1-an2 + an3-an4 -(an5-an6)
print((b-a+1)-an)
Problem p03030 (python)

Fixed submission:
n = int(input())
ls = []
for i in range(n):
    s,t = input().split()
    ls.append([s,-int(t),i+1])
    
ls = sorted(ls)
for i in ls:
  print(i[-1])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ls = []
switch = []
for i in range(n):
    switch.append(i+1)
for i in range(m):
    ks = list(map(int,input().split()))
    ls.append(ks)
p = list(map(int,input().split()))


pattern = []
for i in range(2**n):
    pattern.append(list(bin(i)[2:].zfill(n)))

ans = 0

for i in pattern:
    turn = []
    count = 0
    on = 0
    for j in range(n):
        if i[j] == '1':
            turn.append(switch[j])
    for k in range(m):
        for l in range(1,ls[k][0]+1):
            if ls[k][l] in turn:
                count += 1
        if count % 2 == p[k]:
            on += 1
    if on == m:
        ans += 1
            
print(ans)
Problem p03059 (python)

Fixed submission:
import math

abt = input().split()

count = math.floor(int(abt[2]) / int(abt[0])) * int(abt[1])
print(count)

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

n = int(input())
a = input().split()

i = 0
list = []
while i < n:
    list.append(int(a[i]))
    i += 1
    
gc = functools.reduce(gcd, list)
print(gc)

Buggy submission (verdict: Runtime Error):
import gcd
import functools

n = int(input())
a = input().split()

i = 0
list = []
while i < n:
    list.append(int(a[i]))
    i += 1
    
gc = functools.reduce(gcd, list)
print(gc)
Problem p03076 (python)

Fixed submission:
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i//10
ans = 0
for i in ls:
    ans += math.ceil(i)

lsls = [0]
for i in range(len(ls)):
    ls_one = str(ls[i])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))

Buggy submission (verdict: Runtime Error):
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i/10
ans = 0
for i in ls:
    ans += math.ceil(i)

one = 0
lsls = []
for i in range(len(ls)):
    ls_one = str(ls[i])
    one += int(ls_one[-1])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))

Buggy submission (verdict: Runtime Error):
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i//10
ans = 0
for i in ls:
    ans += math.ceil(i)

one = 0
lsls = []
for i in range(len(ls)):
    ls_one = str(ls[i])
    one += int(ls_one[-1])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))
Problem p03160 (python)

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

dp = [0,abs(h[1]-h[0])]

for i in range(2,n):
    dp.append(min(dp[i-1] + abs(h[i]-h[i-1]),dp[i-2] + abs(h[i]-h[i-2])))
    
print(dp[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
ans = 0
index = 0
if n == 2:
    print(abs(h[index]-h[index+1]))
else:
    for i in range(n):
        if abs(h[index]-h[index+1]) < abs(h[index]-h[index+2]):
            ans += abs(h[index]-h[index+1])
            index += 1
        elif abs(h[index]-h[index+1]) > abs(h[index]-h[index+2]):
            ans += abs(h[index]-h[index+2])
            index += 2
        else:
            ans += abs(h[index]-h[index+2])
            index += 2
        if index == n-1:
            print(ans)
            break
Problem p03163 (python)

Fixed submission:
n,W = map(int,input().split())
w = []
v = []
for i in range(n):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)

dp = [[0]*(W+1) for j in range(n+1)]

for i in range(n-1,-1,-1):
    for j in range(W+1):
        if j < w[i]:
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-w[i]]+v[i])
print(dp[0][W])

Buggy submission (verdict: Runtime Error):
N,W = map(int,input().split())
w = []
v = []
for i in range(N):
    x,y = map(int,input().split())
    w.append(x)
    v.append(y)

dp = [[0]*(W+1) for j in range(N)]

for i in range(N-1,-1,-1):
    for j in range(W+1):
        if j < w[i]:
            dp[i][j] = dp[i+1][j]
        else:
            dp[i][j] = max(dp[i+1][j],dp[i+1][j-w[i]]+v[i])
print(dp[0][W])
Problem p03243 (python)

Fixed submission:
n = list(input())
ls = []
for i in range(3):
  ls.append(int(n[i]))
  
if ls[0] >= ls[1] and ls[0] >= ls[2]:
  for i in range(3):
    print(ls[0],end="")
else:
  for i in range(3):
    print(ls[0]+1,end="")

Buggy submission (verdict: Runtime Error):
n = list(int(input()))
for i in range(3):
  print(max(n))
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int,input().split())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
if max(X)+1 <= min(Y) and max(X) > x and min(Y) <= y:
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(int,input().split())
X = map(int,input().split())
Y = map(int,input().split())
if max(X)+1 <= min(Y) and max(X) > x and min(Y) <= y:
    print("No War")
else:
    print("War")
Problem p03360 (python)

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans + ans
print(ans+min(a,b,c)+a+b+c-max(a,b,c)-min(a,b,c))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans + ans
print(ans+min(a,b,c)+a+b+c-max(a,b,c)-min(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans × 2
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans = ans×2
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k):
  ans ×= 2
print(ans)
Problem p03407 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b <= c:
  print("Yes)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b <= c:
	print("Yes)
else:
	print("No")
Problem p03434 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
alice = 0
bob = 0
for i in range(1,n+1):
  if i%2==1:
    alice += max(a)
    a.remove(max(a))
  else:
    bob += max(a)
    a.remove(max(a))
    
print(alice-bob)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
alice = 0
bob = 0
for i in range(1,n+1):
  if i%2==1:
    alice += max(a)
    del max(a)
  else:
    bob += max(a)
    del　max(a)
Problem p03474 (python)

Fixed submission:
a,b = map(int,input().split())
s = list(input())
if s[a] == "-":
    s.remove(s[a])

    ls = "0123456789"
    c = 0
    for i in s:
        if i in ls:
            c += 1

    if c == a+b:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
s = input()
if s[a] == "-":
    s.remove(s[a])
    if "-" in s:
        print("No")
    else:
        print("Yes")
Problem p03545 (python)

Fixed submission:
import sys
s = (input())
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
ls = ["+","-"]
ans = a+b+c+d
if ans == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
    sys.exit()
ans = a+b+c-d
if ans == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
    sys.exit()
ans = a+b-c+d
if ans == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
    sys.exit()
ans = a-b+c+d
if ans == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
    sys.exit()
ans = a-b-c+d
if ans == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
    sys.exit()
ans = a+b-c-d
if ans == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
    sys.exit()
ans = a-b+c-d
if ans == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
    sys.exit()
ans = a-b-c-d
if ans == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
a,b,c,d = map(int,input())
ans = a+b+c+d
if ans == 7:
    print(s[0]+"+"+s[1]+"+"+s[2]+"+"+s[3]+"=7")
    sys.exit()
ans = a+b+c-d
if ans == 7:
    print(s[0]+"+"+s[1]+"+"+s[2]+"-"+s[3]+"=7")
    sys.exit()
ans = a+b-c+d
if ans == 7:
    print(s[0]+"+"+s[1]+"-"+s[2]+"+"+s[3]+"=7")
    sys.exit()
ans = a-b+c+d
if ans == 7:
    print(s[0]+"-"+s[1]+"+"+s[2]+"+"+s[3]+"=7")
    sys.exit()
ans = a-b-c+d
if ans == 7:
    print(s[0]+"-"+s[1]+"-"+s[2]+"+"+s[3]+"=7")
    sys.exit()
ans = a+b-c-d
if ans == 7:
    print(s[0]+"+"+s[1]+"-"+s[2]+"-"+s[3]+"=7")
    sys.exit()
ans = a-b+c-d
if ans == 7:
    print(s[0]+"-"+s[1]+"+"+s[2]+"-"+s[3]+"=7")
    sys.exit()
ans = a-b-c-d
if ans == 7:
    print(s[0]+"-"+s[1]+"-"+s[2]+"-"+s[3]+"=7")
    sys.exit()

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()
ls = ["+","+","+"]
p = 0
for i in range(3**2):
    for j in range(len(ls)):
        if (i >> n) & 1:
            ls[j] = "-"
    if (eval(a+ls[0]+b+ls[1]+c+ls[2]+d)) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break

Buggy submission (verdict: Runtime Error):
a,b,c,d = input()
ls = ["+","+","+"]
p = 0
for i in range(3**2):
    for j in range(len(ls)):
        if (i >> n) & 1:
            ls[j] = "-"
    if (eval(a+ls[0]+b+ls[1]+c+ls[2]+d)) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break
Problem p03547 (python)

Fixed submission:
x,y = map(str,input().split())
dic = {"A":10,"B":11,"C":12,"D":13,"E":14,"F":15}
if x == y:
  print("=")
elif dic[x] > dic[y]:
  print(">")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
x,y = map(str,input().split())
dic = {10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"}
if x == y:
  print("=")
elif dic[x] > dic[y]:
  print(">")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
x,y = map(str,input().split())
dic = {10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"}
if x == y:
  print("=")
elif dic{x} > dic{y}:
  print(">")
else:
  print("<")
Problem p03712 (python)

Fixed submission:
h,w = map(int,input().split())
for i in range(w+2):
    print("#",end="")
print("")
for i in range(h):
    a = input()
    print("#" + a + "#")

for i in range(w+2):    
    print("#",end="")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
for i in range(w):
    print("#",end="")
print("")
for i in range(h):
    a = input()
    print("#" + a + "#")

for i in range(w):    
    print("#",end=")
Problem p03738 (python)

Fixed submission:
a = int(input())
b = int(input())
if a == b:
    print("EQUAL")
elif a > b:
    print("GREATER")
else:
    print("LESS")

Buggy submission (verdict: Runtime Error):
a,b = int(input())
b = int(input())
if a == b:
    print("EQUAL")
elif a > b:
    print("GREATER")
else:
    print("LESS")
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):
a,b,c = map(int,input().split())
if b−a == c−b:
  print("YES")
else:
  print("NO")
Problem p03826 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
print(max(a*b,c*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(max(a*b,c*d)
Problem p03853 (python)

Fixed submission:
h,w = map(int,input().split())
for i in range(h):
    c = input()
    print(c)
    print(c)

Buggy submission (verdict: Runtime Error):
9 20
.....***....***.....
....*...*..*...*....
...*.....**.....*...
...*.....*......*...
....*.....*....*....
.....**..*...**.....
.......*..*.*.......
........**.*........
.........**.........
Problem p03943 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b == c:
  print("Yes")
elif b+c == a:
  print("Yes")
elif c+a== b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b = c:
  print("Yes")
elif b+c = a:
  print("Yes")
elif c+a=b:
  print("Yes")
else:
  print("No")
Problem p04029 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n+1):
  ans += i
  
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(a,n):
  ans += i
  
print(ans)
Problem p04033 (python)

Fixed submission:
import sys
a,b = map(int,input().split())
c = 0
if (a+b) == 0:
    print("Zero")
    sys.exit()
elif a < 0 and b < 0:
    if  (a-b) % 2 == 1:
        print("Positive")
        sys.exit()
elif a < 0 and b >= 0:
    if a%2 == 0:
        print("Positive")
        sys.exit()
elif b < 0 and a >= 0:
    if b % 2 == 0:
        print("Positive")
        sys.exit()
if (a+b) > 0:
    print("Positive")
else:
    print("Negative")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0):
    print("Positive")
elif (a-b) == 0 or (b-a) == 0:
    print("Zero")
elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0):
    print("Negative")
print()

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0):
    print("Positive")
elif (a-b) == 0 or (b-a) == 0:
    print("Zero")
elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0):
    print("Negative")
Problem p02553 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a, b, c, d = map(int, input().split())

ans = max(a * c, a * d, b * c, b * d)

if ans < 0 and (a <= 0 <= b or c <= 0 <= d):
    print(0)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a, b, c, d = map(int, input().split())

if a >= 0 and c >= 0:
    print(b * d)
    sys.exit(0)

if b <= 0 and d <= 0:
    print(a * c)
    sys.exit(0)

if a <= 0 <= b and c <= 0 <= d:
    print(max(a * c, b * d))
    sys.exit(0)

if b <= 0 and c >= 0:
    pritn(b * c)
    sys.exit(0)

if d <= 0 and a >= 0:
    print(a * d)
    sys.exit(0)

if a <= 0 <= b and d <= 0:
    print(0)
    sys.exit(0)

if c <= 0 <= d and b <= 0:
    print(0)
    sys.exit(0)
Problem p02842 (python)

Fixed submission:
n = int(input())

import math

def cal():
    for i in range(n+1):
        if n == math.floor(i * 1.08):
            return i
    return 0

ans = cal()
if ans:
    print(ans)
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def bs(ok, ng, cond):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if cond(mid):
            ok = mid
        else:
            ng = mid
    return mid

ans = bs(n, 0, lambda x: (x * 1.08) >= n)
if int(ans * 1.08) == n:
    print(ans)
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def bs(ok, ng, cond):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if cond(mid):
            ok = mid
        else:
            ng = mid
    return mid

ans = bs(n, 0, lambda x: (x * 1.08) >= n)
if int(ans * 1.08) == n:
    print(ans)
else:
    print(':(')
Problem p02910 (python)

Fixed submission:
s = input()

import sys

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        sys.exit(0)
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        sys.exit(0)
print('Yes')

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

import sys

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        sys.exit(1)
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        sys.exit(1)
print('Yes')