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

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=<8 and b=<8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=<8 and b<=8:
    print("Yay!")
else:
    print(":(")
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

Buggy submission (verdict: Runtime Error):
a,b=map(input().split())
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")
Problem p02556 (python)

Fixed submission:
N = int(input())
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
if x1+y1 > x2+y2:
    max1 = x1+y1
    min1 = x2+y2
else:
    max1 = x2+y2
    min1 = x1+y1

if x1-y1 > x2-y2:
    max2 = x1-y1
    min2 = x2-y2
else:
    max2 = x2-y2
    min2 = x1-y1

for i in range(N-2):
    x, y = map(int, input().split())
    if x+y > max1:
        max1 = x+y
    elif x+y < min1:
        min1 = x+y
    
    if x-y > max2:
        max2 = x-y
    elif x-y < min2:
        min2 = x-y


ans = print(max((max1-min1),(max2-min2)))

Buggy submission (verdict: Runtime Error):
N = int(input())
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
if x1+y1 > x2+y2:
    xmax = x1+y1
    xmin = x2+y2
else:
    max1 = x2+y2
    min1 = x1+y1

if x1-y1 > x2-y2:
    max2 = x1-y1
    min2 = x2-y2
else:
    max2 = x2-y2
    min2 = x1-y1

for i in range(N-2):
    x, y = map(int, input().split())
    if x+y > max1:
        max1 = x+y
    elif x+y < min1:
        min1 = x+y
    
    if x-y > max2:
        max2 = x-y
    elif x-y < min2:
        min2 = x-y

print(max((max1-min1), (max2-min2)))
Problem p02614 (python)

Fixed submission:
import itertools

H, W, K = map(int, input().split())
c = [['.' for j in range(6)] for i in range(6)]
for i in range(H):
    tmp = str(input())
    for j in range(len(tmp)):
        c[i][j] = tmp[j]
    
hp = list(itertools.product([0,1], repeat=H))
wp = list(itertools.product([0,1], repeat=W))

hl = []
for elem in hp:
    hl.append([i for i, x in enumerate(list(elem)) if x == 1])
wl = []
for elem in wp:
    wl.append([i for i, x in enumerate(list(elem)) if x == 1])

# print(hl)
# print(wl)


def func(hli, wli, c):
    tmp = 0
    for i in range(len(hli)):
        for j in range(len(wli)):
            if c[hli[i]][wli[j]] == '#':
                tmp += 1 
            
    return tmp


ans  = 0
for hli in hl:
    for wli in wl:
        if func(hli, wli, c) == K:
            ans += 1


print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

H, W, K = map(int, input().split())
c = [['.' for j in range(6)] for i in range(6)]
for i in range(H):
    tmp = str(input())
    for j in range(len(tmp)):
        c[i][j] = tmp[j]
    
hp = list(itertools.product([0,1], repeat=H))
wp = list(itertools.product([0,1], repeat=W))

hl = []
for elem in hp:
    hl.append([i for i, x in enumerate(list(elem)) if x == 1])
wl = []
for elem in wp:
    wl.append([i for i, x in enumerate(list(elem)) if x == 1

def func(hli, wli, c):
    tmp = 0
    for i in range(len(hli)):
        for j in range(len(wli)):
            if c[hli[i]][wli[j]] == '#':
                tmp += 1 
            
    return tmp

ans  = 0
for hli in hl:
    for wli in wl:
        if func(hli, wli, c) == K:
            ans += 1

print(ans)
Problem p02639 (python)

Fixed submission:
x1, x2, x3, x4, x5 = map(int, input().split())
if x1 == 0:
    print(1)
elif x2 == 0:
    print(2)
elif x3 == 0:
    print(3)
elif x4 == 0:
    print(4)
elif x5 == 0:
    print(5)

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

T = [False]*(10**6+1)
D = [0]*(10**6+1)
for i in A:
    # iの2以上の倍数の値はTrueに
    for j in range(i*2, 10**6+1, i):
        T[j] = True
    # ダブってる値は2以上に
    D[i] += 1

# TがFalseかつDが1の数を数える
ans = 0
for i in A:
    if T[i] == False and D[i] == 1:
        ans += 1

print(ans)
Problem p02647 (python)

Fixed submission:
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    Z = [N]*N

    while K > 0 and A != Z:
        K-=1
        B = [int(0)]*(N+1)
        for i in range(N):
            B[max(int(0),i-A[i])]+=1
            B[min(N-1,i+A[i])+1]-=1
        for i in range(1,N):
            B[i]+=B[i-1]

        A = B[0:N]

    print(' '.join(map(str,A)))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
tmp = input().split(' ')
A = []
for i in range(N):
    A = A + [int(tmp[i])]

Z = np.array([[abs(j - i) for j in range(N)] for i in range(N)])

B = [0]*5
while K > 0:
    K = K - 1
    Ac = np.array([A]*N-Z)
    for i in range(N):
        B[i] = np.count_nonzero(Ac[i] >= 0)

    A[:] = B[:]

print(' '.join(map(str,A)))
Problem p02658 (python)

Fixed submission:
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if int(b[i]) == 0:
        c = 0

if c == 1:
    for i in range(a):
        c = c*int(b[i])
        if c > 1000000000000000000:
            break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)

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

for i in range(a):
    if b[i] == 0:
        print(0)
        return

c = 1
for i in range(a):
    c = c*int(b[i])
    if c > 1000000000000000000:
        break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)
Problem p02675 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# あまりの計算
b = a%10
# 出力するテキスト
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  out = 'hon'
elif b == 0 or b == 1 or b == 6 or b == 8:
  out = 'pon'
elif b == 3:
  out = 'bon'
# 出力
print("{}".format(out))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# あまりの計算
b = a - (a%10)*10
# 出力するテキスト
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  out = 'hon'
elif b == 0 or b == 1 or b == 6 or b == 8:
  out = 'pon'
elif b == 3:
  out = 'bon'
# 出力
print("{}".format(out))
Problem p02732 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

Aset = set(A)
lst = {}
for i in Aset:
    lst[i] = 0
    
for i in range(N):
    lst[A[i]] += 1

llst = dict(lst) # llst は、valueが1のものを消したリスト
for i in lst:
    if lst[i] == 1:
        llst.pop(i)

c = dict(lst) # c は keyの値である場合の組み合わせの数。
              # c = dict(lst)で異なるオブジェクトとして等価なcを定義
              # c = lst だと、同一のオブジェクトとなってしまう？
c_all = 0
for j in llst:
    c_all += llst[j]*(llst[j]-1)//2

# print('c_all:{}'.format(c_all))
for i in lst:
#     print('i:{}'.format(i))
#     print('lst[i]:{}'.format(lst[i]))
    c[i] = c_all
    c[i] = c[i] - lst[i]*(lst[i]-1)//2 + (lst[i]-1)*(lst[i]-2)//2
        
for i in range(N):
    print(c[A[i]])

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

# N = 5
# A = [1, 1, 2, 1, 2]

Aset = set(A)
lst = {}
for i in Aset:
    lst[i] = 0

# print(lst)
    
for i in range(N):
    lst[A[i]] += 1

# print(lst)
# c = dict(lst) # c = dict(lst)で異なるオブジェクトとして等価なcを定義
              # c = lst だと、同一のオブジェクトとなってしまう？

for i in lst:
#     print('i: {}'.format(i))
    c[i] = 0
    tmp_lst = dict(lst)
#     print('tmp_lst {}'.format(tmp_lst))
#     print('tmp_lst[i]: {}'.format(tmp_lst[i]))
    tmp_lst[i] -= 1
#     print('tmp_lst[i]: {}'.format(tmp_lst[i]))
    for j in tmp_lst:
#         print(tmp_lst[j])
        c[i] += tmp_lst[j]*(tmp_lst[j]-1)//2
#         print('c[i]: {}'.format(c[i]))
        
for i in range(N):
    print(int(c[A[i]]))

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

# N = 5
# A = [1, 1, 2, 1, 2]

Aset = set(A)
lst = {}
for i in Aset:
    lst[i] = 0

# print(lst)
    
for i in range(N):
    lst[A[i]] += 1

# print(lst)
# c = dict(lst) # c = dict(lst)で異なるオブジェクトとして等価なcを定義
              # c = lst だと、同一のオブジェクトとなってしまう？

for i in lst:
#     print('i: {}'.format(i))
    c[i] = 0
    tmp_lst = dict(lst)
#     print('tmp_lst {}'.format(tmp_lst))
#     print('tmp_lst[i]: {}'.format(tmp_lst[i]))
    tmp_lst[i] -= 1
#     print('tmp_lst[i]: {}'.format(tmp_lst[i]))
    for j in tmp_lst:
#         print(tmp_lst[j])
        c[i] += tmp_lst[j]*(tmp_lst[j]-1)//2
#         print('c[i]: {}'.format(c[i]))
        
for i in range(N):
    print(c[A[i]])
Problem p02555 (python)

Fixed submission:
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))

Buggy submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
  array = np.zeros(s)
  array[2] = 1
  array[3] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s])

Buggy submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
  array = np.zeros(s)
  array[2] = 1
  array[3] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s])

Buggy submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
	array = np.zeros(s)
	array[2] = 1
	array[3] = 1
    for i in range(4, s):
      array[i] = (array[i-1] + array[i-3]) % mod
	print(array[s])
Problem p04043 (python)

Fixed submission:
array = list(map(int, input().split()))                                                        
  
array.sort()

if array[0] == 5 and array[1] == 5 and array[2] == 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
array = list(map(int, input().split()))                                                        
  
sort_array = array.sort()
 
for i in range(len(array)):
    if i == 0 and sort_array[i] == 5:
        continue
    elif  i==0 and not(sort_array[i]) == 5:
        print("No")
        break
 
    if i==1 and sort_array[i] == 5:
        continue
    elif  i==1 and not(sort_array[i]) == 5:
        print("No")
        break
 
 
    if i==2 and sort_array[i] == 7:
        print("YES")
    elif  i==2  and not(sort_array[i]) == 7:
        print("NO")
        break

Buggy submission (verdict: Runtime Error):
array = list(map(int, input().split()))                                                        
  
sort_array = array.sort()
 
for i in range(len(array)):
    if i == 0 and array[i] == 5:
        continue
    elif  i==0 and not(array[i]) == 5:
        print("No")
        break
 
    if i==1 and array[i] == 5:
        continue
    elif  i==1 and not(array[i]) == 5:
        print("No")
        break
 
 
    if i==2 and array[i] == 7:
        print("Yes")
    elif  i==2  and not(array[i]) == 7:
        print("No")
        break
~
Problem p02658 (python)

Fixed submission:
N = int(input())
line = [int(i) for i in input().split()]
sum = 1
line.sort(reverse=True)
if line[len(line) -1]== 0:
  print(0)
  exit()
for num in line:
  sum = sum * num
  if sum > 10 ** 18:
    print(-1)
    exit()
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 1
for i in range(N):
  a = int(input())
  sum = sum * a
print(sum)
Problem p02675 (python)

Fixed submission:
N = int(input())
N = N % 10
if N == 2 or N == 4 or N == 5 or N == 7 or N == 9:
     print('hon')
elif N == 3:
    print('bon')
else:
    print('pon')

Buggy submission (verdict: Runtime Error):
input()
 N = N % 10
if N == 2 or N == 4 or N == 5 or N == 7 or N == 9:
     print('hon')
elif N == 3:
    print('bon')
else:
    print('pon')
Problem p02687 (python)

Fixed submission:
S = input()
if S[1] == "B":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if S[1] = "B":
  S[1] = "R"
else:
  S[1] = "B"
print(S)
Problem p02582 (python)

Fixed submission:
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R" and s[2]!="R" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R" and s[2]!="R" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0

Buggy submission (verdict: Runtime Error):
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R" and s[2]!="R" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0
Problem p02641 (python)

Fixed submission:
import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
x,n=get_ints()
p=get_array()
ans1=x 
ans2=x
for j in range(x,-100,-1):
    if j not in p:
        ans1=j 
        break
for k in range(x,200):
    if k not in p:
        ans2=k 
        break
if ans2-x<x-ans1:
    print(ans2)
elif x-ans1<ans2-x:
    print(ans1)
else:
    print(ans1)

Buggy submission (verdict: Runtime Error):
import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
x,n=get_ints()
p=get_array()
for j in range(x,0,-1):
    if j not in p:
        ans1=j 
        break
        
for k in range(x,102):
    if k not in p:
        ans2=k 
        break
if ans2-x<x-ans1:
    print(ans2)
elif x-ans1<ans2-x:
    print(ans1)
else:
    print(ans1)

Buggy submission (verdict: Runtime Error):
import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
x,n=get_ints()
p=get_array()
for i in range(1,102):
    if i==x:
        for j in range(i,0,-1):
            if j in p:
                continue 
            else:
                ans1=j
                break
        for k in range(i,102):
            if k in p:
                continue 
            else:
                ans2=k 
                break
        break 
if ans2-x<x-ans1:
    print(ans2)
elif x-ans1<ans2-x:
    print(ans1)
else:
    print(ans1)
Problem p02601 (python)

Fixed submission:
import sys
r,g,b = map(int,input().split())
k = int(input())
#青＞緑＞赤
count = 0
if g*(2**k)>r:
    while g<=r:
        g*=2
        count += 1
else:
    print("No")
    sys.exit(0)

if b*(2**(k-count))>g:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
k = int(input())
#青＞緑＞赤
r,g,b = 0,0,0
for i,num in enumerate(a):
    if i==0:
        r = num
    elif i==1:
        g = num
    elif i==2:
        b = num

for i in range(k):
    if g<r:
        g *= 2
        count += 1
    elif b<g:
        b *= 2
        count += 1
    
    if b>g and g>r:
        break

if b>g and g>r:
    print("Yes")
else:
    print("No")
Problem p02602 (python)

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

for i in range(k,n):
    if a[i-k] < a[i]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
index = 2
result=[]
for i in range(n-k):
    score1 = a[i]*a[i+1]*a[i+2]
    score2 = a[i+1]*a[i+2]*a[i+3]
    if score1<score2:
        result.append(True)
    else:
        result.append(False)
for j in result:
    if j:
        print("Yes")
    else:
        print("No")
Problem p03264 (python)

Fixed submission:
a=int(input())
if a%2==0:
  ans=int((a/2)**2)
else:
  ans=int(((a-1)/2)*((a+1)/2))
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
if a%2==0:
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
if(a%2==0):
  ans=(a/2)**2
  return ans
else:
  ans=((a-1)/2)*((a+1)/2)
  return ans
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
if(a%2==0):
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
if(a%2==0):
  ans=(a/2)**2
  return
else:
  ans=((a-1)/2)*((a+1)/2)
  return
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
if(a%2==0):
  print((a/2)**2)
  return
else:
  print(((a-1)/2)*((a+1)/2))

Buggy submission (verdict: Runtime Error):
input(a)
if a/2==0:
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

Buggy submission (verdict: Runtime Error):
input(a)
if a%2==1:
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

Buggy submission (verdict: Runtime Error):
input(a)
if(a%2==1):
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i*j)

Buggy submission (verdict: Runtime Error):
input(a)
if(a%2==1):
	i=(a+1)/2
	j=(a-1)/2
else:
	i=a/2
	j=a/2
print(i+j)

Buggy submission (verdict: Runtime Error):
input(a)
if(a%2==1)
	i=(a+1)/2
	j=(a-1)/2
else 
	i=a/2
	j=a/2
print(i+j)

Buggy submission (verdict: Runtime Error):
input(a)
if(a%2==1)
	i=(a+1)/2
	j=(a-1)/2
else 
	i=a/2
	j=a/2
print(i+j)

Buggy submission (verdict: Runtime Error):
input(a)
if(a%2==1)
 i=(a+1)/2
 j=(a-1)/2
else 
 i=a/2
 j=a/2
print(i+j)
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c=map(int, input().split())
k=max(a+b, a-b)

print(k)

Buggy submission (verdict: Runtime Error):
a, b, c=map(int, input().split())
m=max(max(a+b, a-b),a*b)
print(m)

Buggy submission (verdict: Runtime Error):
a, b, c=map(int,input().split())
m=max(max(a+b, a-b),a*b)
print(m)

Buggy submission (verdict: Runtime Error):
a, b, c=map(int,input().split())
m=max(a+b,a-b,a*b)
print(m)

Buggy submission (verdict: Runtime Error):
a, b, c=map(int,input().split())
m=int(max(a+b,a-b,a*b))
print(m)
Problem p03351 (python)

Fixed submission:
a, b, c, d=map(int,input().split())
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d and k3<=d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d or k3<=d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d || k2<=d:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split())
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d or k2<=d:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split())
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d || k2<=d:
  print("Yes")
else print("No")

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

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=int(abs(a-b))
k2=int(abs(a-c))
k3=int(abs(b-c))
print("Yes" if k2<=d or k1<=d and k3<=d else "No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d || k2<=d:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d || k2<=d:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d or k2<=d:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if k2<=d:
  print("Yes")
elif k1<=d || k2<=d:
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if (k2<d):
  print("Yes")
elif (k1<=d || k2<=d):
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a-b)
k2=abs(a-c)
k3=abs(b-c)
if (k2<=d):
  print("Yes")
elif (k1<=d || k2<=d):
  print("Yes")
else print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split)
k1=abs(a,b)
k2=abs(a,c)
k3=abs(b,c)
if (k2<=d):
  print("Yes")
elif (k1<=d || k2<=d):
  print("Yes")
else print("No")
Problem p03473 (python)

Fixed submission:
a=int(input())
print(48-a)

Buggy submission (verdict: Runtime Error):
a=input()
print(48-a)
Problem p03477 (python)

Fixed submission:
a, b, c, d=map(int,input().split())
if a+b<c+d:
  print("Right")
elif a+b==c+d:
  print("Balanced")
else:
  print("Left")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split())
if a+b<c+d:
  print("Right")
elif a+b=c+d:
  print("Balanced")
else:
  print("Left")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split())
if (a+b<c+d):
  print("Right")
elif (a+b=c+d):
  print("Balanced")
else:
  print("Left")

Buggy submission (verdict: Runtime Error):
a, b, c, d=map(int,input().split())
if (a+b<c+d):
  print("Right")
elif(a+b=c+d):
  print("Balanced")
else:
  print("Left")
Problem p02614 (python)

Fixed submission:
import copy
h, w, k = map(int, input().split())
hw = []
mas = []
mas_su = 0

for i in range(h):
    hwi = input()
    masi = []
    for j in range(w):
        if hwi[j] == "#":
            masi.append(1)
        else:
            masi.append(0)

    mas_su += sum(masi)
    mas.append(masi)

l = 2**(h+w)
ans = 0

for i in range(l):
    test = copy.deepcopy(mas)
    num = 0
    for j in range(h+w):
        if ((i >> j) & 1):
            if j < h:
                for p in range(w):
                    if test[j][p]==1:
                        test[j][p] = 0
                        num += 1
            else:
                for p in range(h):
                    if test[p][j-h]==1:
                        test[p][j-h] = 0
                        num += 1
    if mas_su-num == k:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import copy
h, w, k = map(int, input().split())
hw = []
mas = []
mas_su = 0

for i in range(h):
    hwi = input()
    masi = []
    for j in range(w):
        if hwi[j] == "#":
            masi.append(1)
        else:
            masi.append(0)

    mas_su += sum(masi)
    mas.append(masi)

l = 2**(h+w)
ans = 0

for i in range(l):
    test = copy.deepcopy(mas)
    num = 0
    for j in range(h+w):
        if ((i >> j) & 1):
            if j < h:
                for p in range(w):
                    if test[j][p]==1:
                        test[j][p] = 0
                        num += 1
            else:
                for p in range(h):
                    if test[p][j-w]==1:
                        test[p][j-w] = 0
                        num += 1
    if mas_su-num == k:
        ans += 1

print(ans)