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

Fixed submission:
n,m=map(int,input().split())
s=input()
t=input()
#l=n*m//
import fractions

def agc(n,m,s,t):
    if s[0]!=t[0]:
        return -1
    g=fractions.gcd(n,m)
    if g==1:
        return  n*m
    l=n*m//g
    i=1
    while l*i<m*n:
        if s[int(l*i//m)]!=t[int(l*i//n)]:
            return -1
        i+=1
    return  int(l)
print(agc(n,m,s,t))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=input()
t=input()
#l=n*m//
import fractions

def agc(n,m,s,t):
    if s[0]!=t[0]:
        return -1
    g=fractions.gcd(n,m)
    l=n*m//g
    if s[int(l//m)]!=t[int(l//n)]:
        return -1
    return  int(l)
print(agc(n,m,s,t))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=input()
t=input()
#l=n*m*k
import math


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def agc(n,m,s,t):
    if s[0]!=t[0]:
        return -1
    g=math.gcd(n,m)
    if g==1:
        return  n*m
    l=n*m/g

    if s[int(l//m)]!=t[int(l//n)]:
        return -1
    return  int(l)
print(agc(n,m,s,t))
Problem p03240 (python)

Fixed submission:
def abc(n:int,lst:list):
    l0=list(filter(lambda x:x[2]==0,lst))
    l=list(filter(lambda x:x[2]!=0,lst))
    if len(l0):
        x0 =l[0][0]
        y0=l[0][1]
        h0 =l[0][2]
        ans=[]
        for x in range(101):
            for y in range(101):
                for i in range(len(l)):
                    if abs(x0-x)+abs(y0-y)-abs(l[i][0]-x)-abs(l[i][1]-y) == l[i][2]-h0:
                        if i ==len(l)-1:
                            ans.append([x,y,h0+abs(x0-x)+abs(y0-y)])
                    else:
                        break
        for xyh in ans:
            for i in range(len(l0)):
                if abs(l0[i][0]-xyh[0])+abs(l0[i][1]-xyh[1])>=xyh[2]:
                    if i == len(l0)-1:
                        return xyh
                else:
                    break
    else:
        x0 =lst[0][0]
        y0=lst[0][1]
        h0 =lst[0][2]
        for x in range(101):
            for y in range(101):
                for i in range(1,n):
                    if abs(x0-x)+abs(y0-y)-abs(lst[i][0]-x)-abs(lst[i][1]-y) ==lst[i][2]-h0:
                        if i ==n-1:
                            return x,y,h0+abs(x0-x)+abs(y0-y)
                    else:
                        break
n = int(input())
lst = [list(map(int,input().split())) for i in range(n)]
x,y,h =abc(n,lst)
print(x,y,h)

Buggy submission (verdict: Runtime Error):
def abc(n:int,lst:list):
    h=0
    l=list(map(lambda x:x[2],lst))
    if min(l)==0 and max(l)<201:
        for x in range(101):
            for y in range(101):
                for h in range(n):
                    h+=1
                    for i in range(n):
                        if max(0,h-abs(lst[i][0]-x)-abs(lst[i][1]-y)) ==lst[i][2]:
                            if i ==n-1:
                                return [x,y,h]
                        else:
                            h=0
                            break
    else:
        x0 =lst[0][0]
        y0=lst[0][1]
        h0 =lst[0][2]
        for x in range(101):
            for y in range(101):
                for i in range(1,n):
                    if abs(x0-x)+abs(y0-y)-abs(lst[i][0]-x)-abs(lst[i][1]-y) ==lst[i][2]-h0:
                        if i ==n-1:
                            return x,y,h0+abs(x0-x)+abs(y0-y)
                    else:
                        break
n = int(input())
lst = [list(map(int,input().split())) for i in range(n)]
x,y,h =abc(n,lst)
print(x,y,h)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(n_h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(n_h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
for b in range(h):
    print("".join(lst[b]))

Buggy submission (verdict: Runtime Error):
import numpy as np
h,w=map(int,input().split())
lst=list(list(input()) for i in range(h))
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        lst.pop(h-i-1)
lst=np.array(lst)
lst=np.rot90(lst,k=-1).tolist()
for i in range(len(lst)):
    if "#" not in lst[w-i-1]:
        lst.pop(w-i-1)
lst=np.array(lst)
lst=np.rot90(lst,k=1).tolist()
for b in range(h):
    print("".join(lst[b]))

Buggy submission (verdict: Runtime Error):
import numpy
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
lst=numpy.rot90(lst,k=1)
for a in lst:
    if a=="."*h:
        lst.remove(a)
lst=numpy.rot90(lst,k=-1)
for b in range(h):
    print(lst[b])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
lst=list(map(list,lst))
for i in range(w):
    T=True
    if i>w:
        break
    for b in range(h):
        if lst[b][i]!="." :
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(i)
        w-=1
for b in range(h):
    print("".join(lst[b]))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
for i in range(w):
    T=True
    if i>w:
        break
    for b in range(h):
        if lst[b][i]!="." :
            T=False
            break
    if T==True:
        for b in range(h):
            lst[b]="".join(list(lst[b]).pop(i))
            w-=1
for b in range(h):
    print(lst[b])
Problem p03281 (python)

Fixed submission:
n=int(input())
ansList=[105, 135, 165, 189, 195]
m=len(list(filter(lambda x:x<=n,ansList)))
print(m)

Buggy submission (verdict: Runtime Error):
print(len(list(filter(lambda x:x<=int(input()),[105, 135, 165, 189, 195]))))
Problem p03285 (python)

Fixed submission:
n= int(input())
if 4*(2*n//7) -n>=0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n= int(input())
if 4*(2n//7) -n>=0:
    print("Yes")
else:
    print("No")
Problem p03308 (python)

Fixed submission:
input()
lst=list(map(int,input().split()))
lst.sort()
print(lst[-1]-lst[0])

Buggy submission (verdict: Runtime Error):
input()
lst=list(map(int,input().split())).sort()
print(lst[-1]-lst[0])
Problem p02657 (python)

Fixed submission:
A, B = input().split()
A = int(A)
B = int(B)
print(A * B)

Buggy submission (verdict: Runtime Error):
str = input()
arr = input.split(' ')
A = int(arr[0])
B = int(arr[1])

print(A * B)
Problem p02855 (python)

Fixed submission:
h,w,k=map(int,input().split())
s=[list(map(int,input().replace("#",'1').replace(".",'0'))) for i in range(h)]
a=s
tmp=1
for i in range(h):
  if sum(s[i])>0:
    for j in range(w):
      if s[i][j] == 1 and sum(s[i][j+1:])>0:
        a[i][j]=tmp
        tmp+=1
      elif j==w-1:
        a[i][j]=tmp
        tmp+=1
      else:
        a[i][j]=tmp

flg=0
for i in range(h):
  if flg>0 and sum(s[i])==0:
    s[i]=s[i-1]
  else:
    flg=1
for i in reversed(range(h)):
  if sum(s[i])==0:
    s[i]=s[i+1]
for i in range(h):
  print(' '.join(list(map(str,a[i]))))

Buggy submission (verdict: Runtime Error):
h,w,k=map(int,input().split())
s=[list(map(int,input().replace("#",'1').replace(".",'0'))) for i in range(h)]
a=s
tmp=1

for i in range(h):
  if sum(s[i])>0:
    for j in range(w):
      if s[i][j] == 1 and sum(s[i][j+1:])>0:
        a[i][j]=tmp
        tmp+=1
      elif j==w-1:
        a[i][j]=tmp
        tmp+=1
      else:
        a[i][j]=tmp

flg=0
for i in range(h):
  if flg>0 and sum(s[i])==0:
    s[i]=s[i-1]
  else:
    flg=i
for i in reversed(range(h)):
  if sum(s[i])==0:
    s[i]=s[i+1]
for i in range(h):
  print(' '.join(list(map(str,a[i]))))
Problem p03085 (python)

Fixed submission:
b = input()
tmp = ['A','T','A','C','G','C']
for i in range(6):
  if b == tmp[i]:
    print(tmp[i+1])
    break

Buggy submission (verdict: Runtime Error):
b = input()
print('A') if b == 'T'
print('T') if b == 'A'
print('C') if b == 'G'
print('G') if b == 'C'

Buggy submission (verdict: Runtime Error):
n,q = map(int, input().split())
s = input()
lr = [list(map(int,input().split())) for i in range(q)]
for i in range(q):
  print(len(s[lr[i][0]-1:lr[i][1]].replace('AC',':').split(':'))-1)
Problem p03309 (python)

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

b_low=-1*(10**12)
b_high=10**12
b_low_d=sum([abs(a[i]-(b_low+2+i)) for i in range(n)])-sum([abs(a[i]-(b_low+1+i)) for i in range(n)])
b_high_d=sum([abs(a[i]-(b_high+2+i)) for i in range(n)])-sum([abs(a[i]-(b_high+1+i)) for i in range(n)])

while b_high-b_low>10:
  b_tmp=(b_low+b_high)//2
  b_tmp_d=sum([abs(a[i]-(b_tmp+2+i)) for i in range(n)])-sum([abs(a[i]-(b_tmp+1+i)) for i in range(n)])
  if b_tmp_d>0:
    b_high=b_tmp
  else:
    b_low=b_tmp

ans=10**20
for j in range(b_low,b_high):
  ans=min(ans,sum([abs(a[i]-(j+2+i)) for i in range(n)]))

print(ans)

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

b_low=-1*(10**12)
b_high=10**12
b_low_d=sum([abs(a[i]-(b_low+2+i)) for i in range(n)])-sum([abs(a[i]-(b_low+1+i)) for i in range(n)])
b_high_d=sum([abs(a[i]-(b_high+2+i)) for i in range(n)])-sum([abs(a[i]-(b_high+1+i)) for i in range(n)])

while b_high-b_low>10:
  b_tmp=(b_low+b_high)//2
  b_tmp_d=sum([abs(a[i]-(b_tmp+2+i)) for i in range(n)])-sum([abs(a[i]-(b_tmp+1+i)) for i in range(n)])
  if b_tmp_d>0:
    b_high=b_tmp
  else:
    b_low=b_tamp

ans=10**20
for j in range(b_low,b_high):
  ans=min(ans,sum([abs(a[i]-(j+2+i)) for i in range(n)]))

print(ans)
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
f=0
e=len(t)
flg=0
while e<=len(s):
  tmp=s[f:e]
  for i in range(len(t)):
    if tmp[i]!=t[i] and tmp[i]!='?':
      break
    if i==len(t)-1:
      ans=s[:f]+t+s[e:]
      flg=1
  f+=1
  e+=1
if flg==0:
  print('UNRESTORABLE')
else:
  print(ans.replace('?','a'))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
f=0
e=5
flg=0
while e<=len(s):
  tmp=s[f:e]
  for i in range(len(t)):
    if tmp[i]!=t[i] and tmp[i]!='?':
      break
    if i==len(t)-1:
      ans=s[:f]+t+s[e:]
      flg=1
  f+=1
  e+=1
if flg==0:
  print('UNRESTORABLE')
else:
  print(ans.replace('?','a'))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
f=0
e=5
flg=0
while e<=len(s):
  tmp=s[f:e]
  for i in range(len(t)):
    if tmp[i]!=t[i] and tmp[i]!='?':
      break
    if i==len(t)-1:
      s=s[:f]+t+s[e:]
      flg=1
      print(s.replace('?','a'))
  f+=1
  e+=1
if flg==0:
  print('UNRESTORABLE')
Problem p03827 (python)

Fixed submission:
n=int(input())
s=list(input())
x=0
ans=0
for i in range(n):
  if s[i]=='I':
    x+=1
  else:
    x-=1
  ans=max(ans,x)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
x=0
ans=0
for i in range(n):
  if s[i]=='I':
    x+=1
  else s[i]=='D':
    x-=1
  ans=max(ans,x)
print(ans)
Problem p02657 (python)

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

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

print(A*B)

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

print(str(A*B))

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

print(A*B)
Problem p02789 (python)

Fixed submission:

input = list(map(int, input().split()))
N = input[0]
M = input[1]

if N == M:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

input = list(map(int, input().split()))
N = input[0]
M = input[1]

if iN == M:
    print("Yes")
else:
    print("No")
Problem p02802 (python)

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

tempP = ""
ac = []
wa = []

for count in range(N):
    ac.append(0)
    wa.append(0)

for count in range(M):
    P,S = input().split()
    P = int(P)
    P -= 1
    
    if ac[P] == 0:
        if S == "AC":
            ac[P] = 1
        else:
            wa[P] +=1



a = 0
b = 0
 
for i in range(N):
    if ac[i] == 1:
        a += 1
        b += wa[i]
 
print(*[a, b])

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

tempP = ""
ac = []
wa = []

for count in range(N):
    ac.append(0)
    wa.append(0)

for count in range(M):
    P,S = input().split()
    P = int(P)
    P -= 1
    
    if ac[P] == 0:
        if S == "AC":
            ac[P] = 1
        else:
            wa[P] +=1



a = 0
b = 0
 
for i in range(n):
    if ac[i] == 1:
        a += 1
        b += wa[i]
 
print(*[a, b])

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

tempP = ""
ac = []
wa = []

for count in range(M):
    ac.append(0)
    wa.append(0)

for count in range(M):
    P,S = input().split()
    P = int(P)
    P -= 1
    
    if ac[P] == 0:
        if S == "AC":
            ac[P] = 1
        else:
            wa[P] +=1


print(str(sum(ac)) + " " + str(sum(wa)))
Problem p02812 (python)

Fixed submission:
inputA= int(input())
inputB =input()

print(inputB.count('ABC'))

Buggy submission (verdict: Runtime Error):
inputA= int(input())
inputB =map(str,input().split())

print(inputB.count('ABC'))

Buggy submission (verdict: Runtime Error):
inputA= int(input())
inputB =map(str,input())

print(inputB.count('ABC'))

Buggy submission (verdict: Runtime Error):
inputA= int(input())
inputB =map(input())

print(inputB.count('ABC'))

Buggy submission (verdict: Runtime Error):
inputA,inputB =map(input())

print(inputB.count('ABC'))
Problem p02818 (python)

Fixed submission:

inputA,inputB,inputC = map(int, input().split())

if inputC >= inputA:
    if inputB > inputC-inputA:
        print(0,inputB -(inputC-inputA))
    else:
        print(0,0)
else:
    print(inputA-inputC,inputB)

Buggy submission (verdict: Runtime Error):
inputA= int(input())
inputB =map(str,input())

print(inputB.count('ABC'))

Buggy submission (verdict: Runtime Error):

inputA,inputB,inputC = input().split()

if inputC >= inputA:
    if inputB > inputC-inputA:
        print(0,inputB -(inputC-inputA))
    else:
        print(0,0)
else:
    print(inputA-inputC,inputB)
Problem p02898 (python)

Fixed submission:

inputA =  list(map(int,input().split()))
inputB =  list(map(int,input().split()))

humancount = inputA[0]
talllimit = inputA[1]
anser = 0

for count in range(0,humancount):
    if inputB[count] >= talllimit:
        anser += 1


print(anser)

Buggy submission (verdict: Runtime Error):

inputA =  list(map(int,input().split()))
inputB =  list(map(int,input().split()))

humancount = inputA[0]
talllimit = inputA[1]
count= 0

for count in range(0,humancount):
    if inputB(count) >= talllimit:
        count += 1


print(count)
Problem p02993 (python)

Fixed submission:
Sstr = str(input())

if Sstr[0] == Sstr[1] or Sstr[1] == Sstr[2] or Sstr[2] == Sstr[3]:
    print("Bad")
else:
    print("Good")

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

Sstr = str(S)

if Sstr[0] == Sstr[1] or Sstr[1] == Sstr[2] or Sstr[2] == Sstr[3]:
    print("Bad")
else:
    print("Good")
Problem p03795 (python)

Fixed submission:
n = int(input())

x = 800 * n     # 払った金額

# レストランからもらう金額
y = 0
if n >= 15:
    y = 200 * (n//15)

# 払った金額 - レストランからもらうお金
ans = x - y
print(ans)

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

x = 800 * n     # 払った金額

# レストランからもらう金額
if n >= 15:
    y = 200 * (n//15)

# 払った金額 - レストランからもらうお金
ans = x - y
print(ans)
Problem p02945 (python)

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

x = A + B
y = A - B
z = A * B
print(max(x, y, z))

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

x = A + B
y = A - B
z = A * B
print(max(x, y, z))
Problem p02981 (python)

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

# N人*A円がB円より大きい場合
if N * A > B:
    print(B)
else:
    print(N * A)

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

total_price = A + (N * B)

print(total_price - max(total_price))
Problem p03085 (python)

Fixed submission:
# 塩基 A, C, G, T が存在し、A と T、C と G がそれぞれ対

b = input()

if b == ('A'):
    print('T')

if b == ('C'):
    print('G')

if b == ('T'):
    print('A')

if b == ('G'):
    print('C')

Buggy submission (verdict: Runtime Error):
# 塩基 A, C, G, T が存在し、A と T、C と G がそれぞれ対

b = input()

if b == ('A'):
    print(T)

if b == ('C'):
    print(G)

if b == ('T'):
    print(A)

if b == ('G'):
    print(C)

Buggy submission (verdict: Runtime Error):
# 塩基 A, C, G, T が存在し、A と T、C と G がそれぞれ対

b = input()

if b == ('A'):
    print(T)

elif b == ('C'):
    print(G)

elif b == ('T'):
    print(A)

elif b == ('G'):
    print(C)
Problem p03145 (python)

Fixed submission:
AB, BC, CA = map(int, input().split())

print((AB * BC) // 2)

Buggy submission (verdict: Runtime Error):
AB, BC, CA = int(input())

print((AB * BC) // 2)

Buggy submission (verdict: Runtime Error):
ab, bc, ca = int(input())

print((ab * bc) // 2)
Problem p03308 (python)

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

print(max(A) - min(A))

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

print(max(N) - min(N))

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

print(max(A) - min(N))
Problem p03351 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

if abs(A - C) <= D:
    print("Yes")
elif abs(A - B) <= D and abs(B - C) <= D:
    print("Yes")
else:
    print("No")

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

if D >= A + C:
    print("Yes")
elif D >= A + B:
    print("Yes")
else:
    print("No")

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

if D >= A + C:
    print("Yes")
else:
    print("No")
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

train = [A,B]
bus = [C,D]

print(min(train) + min(bus))

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

train = [A,B]
bus = [C,D]

print(min(train) + min(bus))

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

train = [a,b]
bus = [c,d]

print(min(train) + min(bus))

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

train = [a,b]
bus = [c,d]

print(train + bus)

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

train = [a,b]
bus = [c,d]

print(train + bus)
Problem p03555 (python)

Fixed submission:
C1 = str(input())
C2 = str(input())

if C1[0] == C2[-1] and C1[1] == C2[-2] and C1[2] == C2[-3]:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
C1 = str(input())
C2 = str(input())

if C1[0] == C2[1] and C1[1] == C2[2] and C1[2] == C2[3]:
    print('Yes')
else:
    print('No')
Problem p03729 (python)

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

if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
    print('YES')
else:
    print('NO')

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

if a[len(a)-1] == b[0] and b[(b)-1] == c[0]:
    print('YES')
else:
    print('NO')

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

if A == B and B == C:
    print('YES')
else:
    print('NO')
Problem p03826 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

area = [A * B, C * D]

print(max(area))

Buggy submission (verdict: Runtime Error):
S1 = int(input())
S2 = int(input())

if S1 > S2:
    print(S1)
elif S1 == S2:
    print(S1 * S2)
else:
    print(S2)
Problem p02658 (python)

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

judge = True
ans = 0

if 0 not in a:
    ans = 1
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            judge = False
            break
        
if judge:
    print(ans)
else:
    print(-1)

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

judge = True
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        judge = false
        break
        
if judge == True:
    print(ans)
else:
    print(-1)
Problem p02727 (python)

Fixed submission:
from collections import deque
x,y,a,b,c = map(int,input().split())
P = deque(sorted(list(map(int,input().split())),reverse=True)[:x])
Q = deque(sorted(list(map(int,input().split())),reverse=True)[:y])
R = deque(sorted(list(map(int,input().split())),reverse=True))
p = P.pop()
q = Q.pop()
r = R.popleft()
ans = 0

while p < r or q < r:
    ans += r
    if len(R) != 0:   
        r = R.popleft()
    else:
        r = 0
    if p < q:
        if len(P) != 0:   
            p = P.pop()
        else:
            p = 10**10
    else:
        if len(Q) != 0:   
            q = Q.pop()
        else:
            q = 10**10
            
ans += sum(P)+sum(Q)
if p != 10**10:
    ans += p
if q != 10**10:
    ans += q
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
x,y,a,b,c = map(int,input().split())
P = deque(sorted(list(map(int,input().split())),reverse=True)[:x])
Q = deque(sorted(list(map(int,input().split())),reverse=True)[:y])
R = deque(sorted(list(map(int,input().split())),reverse=True))
p = P.pop()
q = Q.pop()
r = R.popleft()
ans = 0
while (p < r or q < r) and r != 0:
    ans += r
    if len(R) != 0:   
        r = R.pop()
    else:
        r = 0
    if p < q:
        if len(p) != 0:   
            p = P.pop()
        else:
            p = 10**10
    else:
        if len(Q) != 0:   
            q = Q.pop()
        else:
            q = 10**10
            
ans += sum(P)+sum(Q)
if p != 10**10:
    ans += p
if q != 10**10:
    ans += q
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
x,y,a,b,c = map(int,input().split())
P = deque(sorted(list(map(int,input().split())),reverse=True)[:x])
Q = deque(sorted(list(map(int,input().split())),reverse=True)[:y])
R = deque(sorted(list(map(int,input().split())),reverse=True))
p = P.pop()
q = Q.pop()
r = R.popleft()
ans = 0
while (p < r or q < r) and r != 0:
    ans += r
    if len(R) != 0:   
        r = R.pop()
    else:
        r = 0
    if p < q:
        p = P.pop()
    else:
        q = Q.pop()
ans += sum(P)+sum(Q)+p+q
print(ans)