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

Fixed submission:
N = int(input())
h = list(map(int, input().split()))
cost_list = [float('inf') for _ in range(N)]
cost_list[0]  = 0

for i in range(1, N):
    if cost_list[i] > (cost_list[i-1] + abs(h[i] - h[i-1])):
        cost_list[i] = cost_list[i-1] + abs(h[i]-h[i-1])

    if i > 1:
        if cost_list[i] > (cost_list[i-2] + abs(h[i] - h[i-2])):
            cost_list[i] = cost_list[i-2] + abs(h[i]-h[i-2])

print(cost_list[N-1])

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
h = list(map(int, input().split()))
cost_list = [math.inf for _ in range(N)]
cost_list[0]  = 0

for i in range(1, N):
    if cost_list[i] > (cost_list[i-1] + abs(h[i] - h[i-1])):
        cost_list[i] = cost_list[i-1] + abs(h[i]-h[i-1])

    if i > 1:
        if cost_list[i] > (cost_list[i-2] + abs(h[i] - h[i-2])):
            cost_list[i] = cost_list[i-2] + abs(h[i]-h[i-2])

print(cost_list[N-1])

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
h = map(int, input().split())
cost_list = [math.inf for _ in range(N)]
cost_list[0]  = 0 

for i in range(1, N):
  if cost_list[i] > (cost_list[i-1] + math.abs(h[i] - h[i-1])):
    cost_list[i] = cost_list[i-1] + math.abs(h[i]-h[i-1])
   
  if i > 1:
    if cost_list[i] > (cost_list[i-2] + math.abs(h[i] - h[i-2])):
      cost_list[i] = cost_list[i-2] + math.abs(h[i]-h[i-2])

print(cost[N-1])
Problem p03862 (python)

Fixed submission:
n,x=map(int,input().split())
a=[int(i)for i in input().split()]
c=0
if a[0]>x:
  c=a[0]-x
  a[0]=x
for i in range(n-1):
  if a[i]+a[i+1]>x:
    c+=a[i]+a[i+1]-x
    a[i+1]=x-a[i]
print(c)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=[int(i)for i in input().split()]
c=0
if a[0]>x:
  c=a[0]-x
  a[0]=x
  for i in range(1,len(a)):
    if a[i]+a[i+1]>x:
      c+=a[i]+a[i+1]-x
      a[i+1]=x-a[i]
print(c)
Problem p04029 (python)

Fixed submission:
print(sum([int(i)for i in range(1,int(input())+1)]))

Buggy submission (verdict: Runtime Error):
print(sum([int(i)for i in range(1,int(input()+1))]))
Problem p04030 (python)

Fixed submission:
a=input()
s=""
for i in a:
  if i=="B":
    s=s[:-1]
  else:
    s+=i
print(s)

Buggy submission (verdict: Runtime Error):
a=input()
b=a.index
while "B" in a:
  if a.startswith("B"):
    a=a[1::]
  elif "B" in a:
    a=a[0:b("B")-1]+a[b("B")+1:]
print(a)
Problem p03485 (python)

Fixed submission:
import math
a, b = map(int, input().split())
mean = (a + b) / 2.0
print(math.ceil(mean))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
mean = (a + b) / 2.0
print(int(math.ceil(mean))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(int(math.ceil(mean))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
mean = (a + b) / 2
print(int(math.ceil(mean))
Problem p03493 (python)

Fixed submission:
s = input()
count = 0
for x in s:
  if x != '0':
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
for x in s:
  if x != '0':
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
for x in s:
  if x != '0':
    count = count + 1

Buggy submission (verdict: Runtime Error):
s = input()
count = 0
for x in len(s):
  if x != '0':
    count = count + 1
print(count)
Problem p03059 (python)

Fixed submission:
A,B,T = map(int,input().split())
a =T//A
number = 0
for i in range(a):
  b=1
  s = a-b
  if s >=0:
    number+=1
  b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T = map(int,input().split())
a =T//A
number = 0
 for i in range(a):
  b=1
  s = a-b
  if s >0:
    number+=1
  b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T = map(int,input().split())
a =T//A
number = 0
 for i in range(a):
  b=1
  s = a-b
  if s >0:
    number+=1
  b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T=map(int,input().split())
a =T//A
 number = 0
 for i in range(a):
  b=1
  s = a-b
  if s >0:
    number+=1
  b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T=(int,input().split())
a =T//A
 number = 0
 for i in range(a):
  b=1
  s = a-b
  if s >0:
    number+=1
  b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T=(int,input().split())
a =T//A
number=0
for i in range(a):
 b=1
 s = a-b
 if s >0:
   number+=1
 b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T=(int,input().split())
int a =T//A
number=0
for i in range(a):
 b=1
 s = a-b
 if s >0:
   number+=1
 b+=1
print(number*B)

Buggy submission (verdict: Runtime Error):
A,B,T=(int,input().split())
int a =T//A
for i in range(a):
 int b=1
 int s = a-b
 if sum >0:
   number++
 b++
print(number*B)
Problem p03060 (python)

Fixed submission:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
sum = 0
for i in range(n):
     if v[i] >c[i]:
      sum += v[i]-c[i]
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split())
c = list(map(int,input().split())
sum = 0
for i in range(n):
     if v[i] >c[i]:
      sum += v[i]-c[i]
print(sum)
Problem p03071 (python)

Fixed submission:
A,B=map(int,input().split())
sum =0
for i in range(2):
  if A >= B:
     sum+=A
     A-=1
  else:
     sum+=B
     B-=1
print(sum)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
     A-=1
  else:
     sum+=B
     B-=1
print(sum)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
      A-=1
  else:
      sum+=B
      B-=1
print(sum)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
      A-=1
   else:
      sum+=B
      B-=1
print(sum)
Problem p03086 (python)

Fixed submission:
a = input()+"a"
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in a:
  　　　　if i in 'ATGC':
    　　　　　　　num+=1
  　　　　else:
    　　　　　　　b.append(num)
    　　　　　　　num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in a:
  if a in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in a:
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i] in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Buggy submission (verdict: Runtime Error):
a = input()
num=0
b=[]
for i in range(len(a)):
  if a[i]　in "ATGC":
    num=1
  else:
    b.appendS(num)
    num=0
print(max(b))
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().sprit())
print((a*b+1)//2)
Problem p03087 (python)

Fixed submission:
N,Q = map(int, input().split())
S = str(input())
# N,Q=8,3
# S = "ACACTACG"
L = [0] * len(S) #ACのAの個数を保持
i = 0
sum_i = 0
while i < len(S)-1:
    if S[i] == "A":
        if S[i+1] == "C":
            L[i] = sum_i
            sum_i += 1
            L[i+1] = sum_i
            i += 2
        elif S[i+1] == "A":
            L[i] = sum_i
            i += 1
        else:
            L[i] = sum_i
            L[i+1] = sum_i
            i += 2
    else:
        L[i] = sum_i
        i += 1
L[len(S)-1] = sum_i
for _ in range(Q):
    l, r = map(int, input().split())
    print(L[r-1] - L[l-1])

Buggy submission (verdict: Runtime Error):
# N,Q = map(int, input().split())
# S = str(input())
N,Q = 8,3
S = "ACACTACG"
L = [0] * len(S) #0はACのAでない
i = 0
while i < len(S)-1:
    if S[i] == "A":
        if S[i+1] == "C":
            L[i] = 1
            i += 1
        elif S[i+1] == "A":
            i += 1
        else:
            i += 2
    else:
        i += 1
for _ in range(Q):
    l, r = map(int, input().split())
    print(sum(L[l-1:r-1]))

Buggy submission (verdict: Runtime Error):
N,Q = map(int, input().split())
S = str(input())
# L = []
# R = []
for _ in range(N):
    l, r = map(int, input().split())
    print(S[l-1:r].count("AC"))
#     L.append(l)
#     R.append(r)
Problem p03125 (python)

Fixed submission:
l=input().split()
a=int(l[0])
b=int(l[1])
if b%a==0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
l=input().split()
a=int(l[0])
b=int(l[1])
if a%b==0:
    print(a+b)
elif:
    print(b-a)
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,intput().split())
print((a*b)//2)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,intput().split())
z=(a*b)/2
print(int(z))
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
x=int(input())
y=int(input())
print(x+(y/2))
Problem p03238 (python)

Fixed submission:
N=int(input())
if(N==1):
    print("Hello World")
else :
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=int(input())
b=int(input())
if(N==1):
    print("Hello World")
else :
    print(a+b)
Problem p03125 (python)

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

if b % a == 0:
	print(a+b)
else:
	print(b-a)

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

if b % a == 0:
	print(a+b)
else:
	print(b-a)
Problem p03281 (python)

Fixed submission:
n = int ( input())
ans = 0
test = (3,5,7,11,13)
for i in range ( 105,n+1,2) :
  div = 0
  for d in test :
    if i % d == 0 :
      div += 1
  if div == 3 and i % 9 != 0:
    ans += 1
  elif i % 27 == 0:
    ans += 1
print (ans)

Buggy submission (verdict: Runtime Error):
n = int ( input())
ans = 0
test = (3,5,7,11,13)
for i in range ( 105,n+1,2) :
  div = 0
  for d in test :
    if i % d == 0 :
      div += 1
  if div == 3 and i % 9 != 0:
    ans += 1
  elif i %= 27:
    ans += 1
print (ans)
Problem p04045 (python)

Fixed submission:
# coding: UTF-8


N, _ = input().split()
N = int(N)

dislike_nums = input().split()

def contains_dislike_number(num):
    for n in dislike_nums:
        if n in str(i):
            return True
    return False

for i in range(N, 10*N+1):
    if not contains_dislike_number(i):
        print(i)
        break

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


N, _ = input().split()
dislike_nums = set(map(int, input().split()))

nums = set(range(10))
nums -= dislike_nums

for i in range(len(N)):
    Ni = int(N[i])
    larger_num = [n for n in nums if n >= Ni]
    print(min(larger_num), end="")

print()
Problem p03035 (python)

Fixed submission:
a,b=map(int,input().split())
if a<=5:
   print(0)
elif a<=12:
   print(b//2)
else:
   print(b)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A >= 13:
  print(B)
elif A >= 6:
  half_b = B/2
  print(half_b)
else:
  print(int(0))

Buggy submission (verdict: Runtime Error):
A = input()
B = input()

if A >= 13:
  print(B)
elif A >= 6:
  print(B/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
#年齢
A = input()
#料金
B = input()

if A >= 13:
  return B
elif 13> A >=6:
  return B/2
else:
  return 0
Problem p03102 (python)

Fixed submission:
import numpy as np

if __name__ == '__main__':
    N, M, C = map(int, input().split())
    B = np.array(list(map(int, input().split())))
    A = np.array(list(map(lambda _: list(map(int, input().split())), range(N))))

    scores = A.dot(B)
    print(np.sum(scores > -C))

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

if __name__ == '__main__':
    N, M, C = map(int, input().split())
    B = np.array(list(map(int, input().split())))
    A = np.array(list(map(lambda _: list(map(int, input().split())), range(N))))

    scores = np.matmul(A, B)
    print(np.sum(scores > -C))
Problem p03238 (python)

Fixed submission:
print(int(input())+int(input())if input()=='2' else "Hello World")

Buggy submission (verdict: Runtime Error):
print(int(input())+int(input())if input()=='1'else"Hello World")
Problem p03244 (python)

Fixed submission:
N = int(input())
a = [[],[]]
[a[i%2].append(t) for i, t in enumerate(map(int, input().split()))]

a_cnt = [{},{}]
for i in range(2):
    for j in range(len(a[i])):
        if a[i][j] in a_cnt[i]:
            a_cnt[i][a[i][j]] += 1
        else:
            a_cnt[i][a[i][j]] = 1

for i in range(2):
    # print(list(a_cnt[i].items()))
    a_cnt[i] = list(sorted(list(a_cnt[i].items()),\
        key=(lambda x:x[1]), reverse=True))[:2]

# print(a_cnt)
if a_cnt[0][0][0] != a_cnt[1][0][0]:
    print(N -a_cnt[0][0][1] -a_cnt[1][0][1])
else:
    if len(a_cnt[0])==1 and len(a_cnt[1])==1:
        print(N//2)
    else:
        ans1 = N -a_cnt[0][0][1] -a_cnt[1][1][1]
        ans2 = N -a_cnt[0][1][1] -a_cnt[1][0][1]
        print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
a = [[], []]
[a[i%2].append(t) for i, t in enumerate(map(int, input().split()))]
print(sum([(lambda x: len(x) -max([x.count(xi) for xi in x]))(ai) for ai in a]))
Problem p03474 (python)

Fixed submission:
A, B = map(int, input().split())
s = input()
for i in range(len(s)):
    if i<A and s[i]=='-':
        print("No")
        exit()
    elif i==A and s[i]!='-':
        print("No")
        exit()
    elif A<i<=A+B and s[i]=='-':
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
a, b = input().split("-")
if len(a)==A and len(b)==B:
    print("Yes")
    exit()
print("No")
Problem p03563 (python)

Fixed submission:
A = int(input())
B = int(input())
print(B*2-A)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(B*2-A))
Problem p03565 (python)

Fixed submission:
S = input()
T = input()

if len(T) > len(S):
    print("UNRESTORABLE")
    exit()

ans = []

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            break
    else:
        ans.append((S[:i] + T + S[i+len(T):]).replace('?', 'a'))

if len(ans) == 0:
    print("UNRESTORABLE")
else:
    ans.sort()
    print(ans[0])

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

for i in range(len(S)-len(T)+1):
    ok = False
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            break
    else:
        S = S[:i] + T + S[i+len(T):]
        ok = True
        break

if ok:
    print(S.replace('?', 'a'))
else:
    print("UNRESTORABLE")
Problem p03625 (python)

Fixed submission:
N = int(input())
A = {}
a = [int(i) for i in input().split()]
for i in range(N):
    if a[i] in A:
        A[a[i]] += 1
    else:
        A[a[i]] = 1

ans = []
A = list(sorted(list(A.items()), reverse=True))
for i in range(N):
    if A[i][1] >= 2:
        ans.append(A[i][0])
    if A[i][1] >= 4:
        ans.append(A[i][0])

    if len(ans) >= 2:
        print(ans[0]*ans[1])
        break
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = {}
a = [int(i) for i in input().split()]
for i in range(N):
    if a[i] in A:
        A[a[i]] += 1
    else:
        A[a[i]] = 1

ans = []
A = list(sorted(list(A.items()), reverse=True))
for i in range(N):
    if A[i][1] >= 2:
        ans.append(A[i][0])
    if A[i][1] >= 4:
        ans.append(A[i][0])

    if len(ans) == 2:
        print(ans[0]*ans[1])
        break
else:
    print(0)
Problem p03696 (python)

Fixed submission:
def insertion(S):
    Sc = S
    Scc = Sc.replace("()", "")
    while Scc != Sc:
        Sc = Scc
        Scc = Scc.replace("()", "")

    # Sc は ((((... or ))))... or ...))))((((...
    # print(Sc)
    if len(Sc) == 0:
        Sl, Sr = "", ""
    elif Sc[0] != Sc[-1]:
        pos = Sc.find(")(")
        Sl = insertion(Sc[:pos+1])[0]
        Sr = insertion(Sc[pos+1:])[2]
    elif Sc[0] == '(':
        Sl = ""
        Sr = ')' * len(Sc)
    else:
        Sl = '(' * len(Sc)
        Sr = ""

    return Sl, S, Sr

N = int(input())
s = insertion(input())
print(s[0]+s[1]+s[2])

Buggy submission (verdict: Runtime Error):
def insertion(S):
    Sc = S
    Scc = Sc.replace("()", "")
    while Scc != Sc:
        Sc = Scc
        Scc = Scc.replace("()", "")

    # Sc は ((((... or ))))... or ...))))((((...
    # print(Sc)
    if Sc[0] != Sc[-1]:
        pos = Sc.find(")(")
        S = insertion(S[:pos+1]) + insertion(S[pos+1:])
    elif Sc[0] == '(':
        S += ')' * len(Sc)
    else:
        S = '(' * len(Sc) + S

    return S

N = int(input())
print(insertion(input()))
Problem p03854 (python)

Fixed submission:
W=["dream", "dreamer", "erase", "eraser"]
word=input()
while True:
    if word=="":
        print("YES")
        exit()

    ok = False
    for w in W:
        if word[-len(w):] == w:
            word = word[:-len(w)]
            ok = True
            break

    if not ok:
        print("NO")
        exit()

Buggy submission (verdict: Runtime Error):
W=["dream", "dreamer", "erase", "eraser" ]
def srch(word):
    if word=="":
        print("YES")
        exit()

    for w in W:
        if word[:len(w)] == w:
            srch(word[len(w):])

srch(input())
print("NO")
Problem p03943 (python)

Fixed submission:
x = [int(i) for i in input().split()]
x.sort()
print("Yes" if x[0]+x[1]==x[2] else "No")

Buggy submission (verdict: Runtime Error):
x = [int(i) for i input().split()]
x.sort()
print("Yes" if x[0]+x[1]==x[2] else "No")
Problem p03997 (python)

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

Buggy submission (verdict: Runtime Error):
print((int(input())+int(input())*int(input())//2)

Buggy submission (verdict: Runtime Error):
print((int(input()+int(input())*int(input()//2)
Problem p03035 (python)

Fixed submission:
a,b=map(int,input().split())
print(b if a>=13 else b//2 if 6<=a<=12 else 0)

Buggy submission (verdict: Runtime Error):
g=lambda:map(int,input().split())
_,m=g()
ml,mr=0,10**5
for _ in range(m):
    l,r=g()
    ml=max(ml,l)
    mr=min(mr,r)
print([0,mr-ml+1][mr>=ml])
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
 
if a <= 5:
	print(0)
        
elif a <= 12:
	print(int(b/2))
        
else:
	print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
 
if a <= 5:
	print("0")
        
elif a <= 12:
	print(b/2)
        
else:
	print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
 
if a <= 5:
	print(0)
        
elif a <= 12:
	print(b/2)
        
else:
	print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())

if a <= 5:
  print("0"
        
elif a <= 12:
        print(b/2)
        
else:
        print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())

if a <= 5:
	print(0)
  
elif a <=12:
	print(b/2)
    
else:
	print(b)
Problem p03035 (python)

Fixed submission:
A,B=map(int, input().split())
if A >= 13:
	print(B)
elif 6<=A<=12:
	print(B//2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A >= 13:
	print(B)
elif 6<=A<=12
	print(B//2)
else:
    print(0)
A,B=map(int, input().split())
if A >= 13:
	print(B)
elif 6<=A<=12:
	print(B//2)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A >= 13:
	print(B)
elif 6<=A<=12
	print(B//2)
else:
    print(0)
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input())
print(X+(Y/2))
Problem p03477 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
L = A + B
R = C + D
if L > R:
  print("Left")
elif L == R:
  print("Balanced")
else:
  print("Right")

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
L = A + B
R = C + D
if L > R:
  print("Left")
elif L = R:
  print("Left")
else:
  print("Left")
Problem p03777 (python)

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

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

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

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

Fixed submission:
s=input()
print("A"+s[8]+"C")

Buggy submission (verdict: Runtime Error):
A=input()
s = input()
C=input()
x = s[0].upper()
print("A"+x+"C")
Problem p03943 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a == b + c or b = c + a or c = b + a:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a == b + c or b = c + a c = b + a:
  print("YES")
else:
  print("NO")
Problem p03962 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a == b == c:
  print(1)
elif a == b or b == c or c == a:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c = int(input())
if a == b == c:
  print(1)
elif a == b or b == c or c == a:
  print(2)
else:
  print(3)
Problem p03035 (python)

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

if 13 <= a :
  print(b)
elif 6 <= a <= 12 :
  print(int(b/2))
else :
  print(0)

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

if 13 <= a :
  print(b)
elif 6 <= a <= 12 :
  print(b/2)
else :
  print(0)
Problem p03035 (python)

Fixed submission:
A, B = map( int, input().split() )
if ( A < 6 ):
  result = 0
elif ( A < 13 ):
  result = B/2
else:
  result = B
  
print( int(result) )

Buggy submission (verdict: Runtime Error):
A, B = int(input())
if ( A < 6 ):
  result = 0
elif ( A < 13):
  result = B/2
else:
  result = B
  
print(result)
Problem p03061 (python)

Fixed submission:
# from math import gcd

def gcd(x, y): 
    while(y): 
        x, y = y, x % y 
    return x 

n = int(input())
A = list(map(int, input().split()))

R = [0] + list(A) + [0]
L = [0] + list(A) + [0]
M = [0] * (n+2)


for i in range(n, 0, -1):
    R[i] = gcd(R[i], R[i+1])


for i in range(1,n+1):
    L[i] = gcd(L[i], L[i-1])

for i in range(1,n+1):
    M[i] = gcd(L[i-1], R[i+1])

# print("A   ", A, " ")
# print("L", L)
# print("R", R)
# print("M", M)
print(max(M))

Buggy submission (verdict: Runtime Error):
from math import gcd

def cR(A, i):
    if i == len(A):
        return 0
    else:
        g = 0
        for i in range(i, len(A)):
            g = gcd(g, A[i])
        return g

def cL(A, i):
    if i == 1:
        return 0
    else:
        g = 0
        for i in range(i+1):
            g = gcd(g, A[i])
        return g


n = int(input())
A = list(map(int, input().split()))
A.append(0)
R = [0] * (n+2)
L = [0] * (n+2)
M = [0] * (n+2)

g = A[n-1]
for i in range(n-1, -1, -1):
    R[i] = gcd(g, A[i])

g = A[0]
for i in range(1,n+1):
    L[i] = gcd(g, A[i-1])

for i in range(n):
    M[i] = gcd(L[i], R[i+1])

# print(L, R, M)
print(max(M))