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

Fixed submission:
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=math.gcd(n,m)
ans=(n*m)//num
numn=n//num
numm=m//num
for i in range(num):
    if s[i*numn]!=t[i*numm]:
        ans=-1
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=(n*m)//math.gcd(n,m)
str1=["A"]*num
ans=num
numn=num//n
numm=num//m
for i in range(n):
    str1[i*(numn)]=s[i]
for i in range(m):
    str2=str1[i*numm]
    if str2!="A" and str2!=t[i]:
        ans=-1
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())
s=list(input())
t=list(input())
num=(n*m)//math.gcd(n,m)
str1=[0]*num
ans=num
numn=num//n
numm=num//m
for i in range(n):
    str1[i*(numn)]=s[i]
for i in range(m):
    str2=str1[i*numm]
    if str2!=0 and str2!=t[i]:
        ans=-1
        break
print(ans)
Problem p03302 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")

Buggy submission (verdict: Runtime Error):
a,b=int(input())
if a+b==15:
    print("+")
elif a*b==15:
    print("*")
else:
    print("x")
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
e=s.count("E")
w=n-e
ans=e
nume=0
numw=0
for i in range(n):
    if s[i]=="E":
        nume+=1
    else:
        numw+=1
    ans=min(ans,numw+e-nume)
print(ans)
Problem p03360 (python)

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

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

Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m))))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//(min(m)))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input) for _ in range(n)]
m.sort()
num=x-sum(m)
print(n+(num//min(m)))
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
counta=0
countb=0
for i in range(x):
    if a.count(i)==1:
        counta+=1
for i in range(x,n+1):
    if a.count(i)==1:
        countb+=1
print(min(counta,countb))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
1count=0
ncount=0
for i in range(x):
    if a.count(i)==1:
        1count+=1
for i in range(x,n+1):
    if a.count(i)==1:
        ncount+=1
print(min(1count,ncount))
Problem p03399 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)+min(c,d))

Buggy submission (verdict: Runtime Error):
n=int(input())
d,x=map(int,input().split())
ans=x
a=[int(input()) for _ in range(n)]
for i in range(n):
    ans+=((d-1)//a[i])+1
print(ans)
Problem p03400 (python)

Fixed submission:
n=int(input())
d,x=map(int,input().split())
ans=x
a=[int(input()) for _ in range(n)]
for i in range(n):
    ans+=((d-1)//a[i])+1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input()
d,x=map(int,input().split())
ans=x
a=[int(input()) for _ in range(n)]
for i in range(n):
    ans+=((d-1)//a[i])+1
print(ans)
Problem p03424 (python)

Fixed submission:
n=int(input())
s=list(input().split())
if s.count("Y")==0:
    print("Three")
else:
    print("Four")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(map(input().split()))
if s.count("Y")==0:
    print("Three")
else:
    print("Four")
Problem p03523 (python)

Fixed submission:
s=input()
str=["A","K","I","H","A","B","A","R","A"]
count=0
ans=0
for i in range(9):
    if count==len(s) and i<8:
        ans=1
        break
    elif count==len(s):
        break
    if s[count]==str[i]:
        count+=1
    elif s[count]!=str[i] and str[i]!="A":
        ans=1
        break
if len(s)>9:
    ans=1
if ans==1:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
s=input()
str=["A","K","I","H","A","B","A","R","A"]
count=0
ans=0
for i in range(9):
    if s[count]!=str[i] and str[i]!="A":
        ans=1
        break
    else:
        if s[count]==str[i]:
            count+=1
if ans==1:
    print("NO")
else:
    print("YES")
Problem p03524 (python)

Fixed submission:
s=list(input())
a=s.count("a")
b=s.count("b")
c=s.count("c")
l1=[a,b,c]
l1.sort()
if l1[0]==0 and l1[1]==1 and l1[2]==1:
    print("YES")
elif min(a,b,c)!=0 and max(a,b,c)-min(a,b,c)<=1:
    print("YES")
elif a+b+c==max(a,b,c) and max(a,b,c)==1:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s=list(input())
a=s.count("a")
b=s.count("b")
c=s.count("c")
if min(a,b,c)!=0 and max(a,b,c)-min(a,b,c)<=1:
    print("YES")
elif a+b+c=max(a,b,c) and max(a,b,c)==1:
    print("YES")
else:
    print("NO")
Problem p03569 (python)

Fixed submission:
s=list(input())
ans=0
for i in range(len(s)):
    if len(s)<=1:
        break
    if s[0]==s[-1]:
        del s[0]
        del s[-1]
    else:
        if s[0]=="x":
            ans+=1
            del s[0]
        elif s[-1]=="x":
            ans+=1
            del s[-1]
        else:
            ans=-1
            break
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
s2=[]
for i in range(len(s)):
    if s[-i-1]!="x":
        num=i+1
        break
s3=["O"]*num
for i in range(len(s)):
    if s[i]!="x":
        s2.append(s[i])
        if i!=len(s)-1:
            if s[i+1]!="x":
                s3.append("O")
    else:
        s3.append("x")
num=0
for i in range(len(s2)//2):
    if s2[i]!=s2[-1-i]:
        num=1
        break
if num==1:
    print(-1)
else:
    ans=0
    for i in range(len(s3)//2):
        if s3[i]!=s3[-i-1]:
            ans+=1
    print(ans)
Problem p03611 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
num=[0]*(max(a)+1)
for i in range(n):
    num[a[i]]+=1
ans=0
if max(a)<3:
    ans=sum(num)
else:
    for i in range(1,max(a)):
        num2=num[i-1]+num[i]+num[i+1]
        if ans<num2:
            ans=num2
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
num=[0]*(max(a)+1)
for i in range(n):
    num[a[i]]+=1
ans=0
for i in range(1,len(a)-1):
    num2=num[i-1]+num[i]+num[i+1]
    if ans<num2:
        ans=num2
print(ans)
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):
o=input()
e=input()
ans=""
for i in range(len(e)):
    ans+=o[i]
    ans+=e[i]
if len(o)!=len(e):
    ans+=o[len(o)-1]
print(ans)
Problem p03777 (python)

Fixed submission:
a,b=input().split()
if a=="H" and b=="H":
    print("H")
elif 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":
    print("H")
elif 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 p03779 (python)

Fixed submission:
x=int(input())
count=0
for i in range(1,x**2+3):
    count+=i
    if count>=x:
        break
print(i)

Buggy submission (verdict: Runtime Error):
x=int(input())
count=0
for i in range(1,x**2):
    count+=i
    if count>=x:
        break
print(i)
Problem p03838 (python)

Fixed submission:
x,y=map(int,input().split())
if x>0 and y>0:
    if x<=y:
        print(y-x)
    else:
        print(x-y+2)
elif x<0 and y<0:
    if x<=y:
        print(y-x)
    else:
        print(x-y+2)
else:
    if y==0 or x==0:
        if y<0 or x>0:
            print(abs(y)+abs(x)+1)
        else:
            print(abs(y)+abs(x))
    else:
        print(abs(abs(x)-abs(y))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
a=[]
b=[]
ans=[]
yn=0
count=1
count2=0
count3=0
for i in range(n):
    check=i*n+((n-i-1)*(n-i))//2
    if check+i+1<x[i] or x[i]<((i+2)*(i+1))//2:
        yn+=1
        break
lena=len(a)
if yn==1:
    print("No")
else:
    print("Yes")
    for i in range(n):
        for j in range(i):
            a.append(i+1)
    for i in range(n):
        for j in range(n-i-1):
            b.append(i+1)
    for i in range(n*n):
        if x.count(i+1)==1:
            ans.append(count)
            count+=1
        else:
            if count2<lena:
                ans.append(a[count2])
                count2+=1
            else:
                ans.append(b[count3])
                count3+=1
    print(*ans)
Problem p03841 (python)

Fixed submission:
def solve():
    n=int(input())
    x=list(map(int,input().split()))
    list1=[]
    def ap1(num):
        list1.append(num)
    for i in range(n):
        ap1([x[i],i+1])
    str1= lambda val: val[0]
    list1.sort(key=str1)
    numa=[]
    numb=[]
    for i in range(n):
        num3=list1[i][1]
        numa+=[num3]*(num3-1)
        numb+=[num3]*(n-num3)
    count1=0
    count2=0
    count3=0
    ans=[]
    ansnum=0
    def countnum(num):
        return ans.count(num)
    def apans(num):
        ans.append(num)
    for i in range(n*n):
        yn=0
        if count1!=n:
            if i==list1[count1][0]-1:
                if countnum(list1[count1][1])!=list1[count1][1]-1:
                    ansnum=1
                    break
                apans(list1[count1][1])
                count1+=1
                yn=1
        if yn==0:
            if count2!=len(numa):
                apans(numa[count2])
                count2+=1
            elif count3!=len(numb):
                apans(numb[count3])
                count3+=1
            else:
                if i!=n*n-1:
                    ansnum=1
                    break
    if ansnum==1:
        print("No")
    else:
        print("Yes")
        print(*ans)
solve()

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
num=[]
num2=[]
ans=[]
count=0
numcount=0
numcount2=0
yn=0
for i in range(2,n+1):
    num+=[i]*(i-1)
for i in range(1,n):
    num2+=[i]*(n-i)
for i in range(n*n):
    if x[count]==i+1:
        if numcount<((count+1)*count)//2:
            yn=1
            break
        elif len(num2)-((n-count)*(n-count-1))//2<numcount2:
            yn=1
            break
        else:
            ans+=str(count+1)
        count+=1
    else:
        if numcount<len(num):
            ans+=str(num[numcount])
            numcount+=1
        elif numcount2<len(num2):
            ans+=str(num2[numcount2])
            numcount2+=1
        else:
            yn=1
            break
if yn==1:
    print("No")
else:
    print("Yes")
    print(*ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
a=[]
b=[]
ans=[]
yn=0
count=1
count2=0
count3=0
for i in range(n):
    check=i*n+((n-i-1)*(n-i))//2
    if check+i+1<x[i] or x[i]<((i+2)*(i+1))//2:
        yn+=1
        break
lena=len(a)
if yn==1:
    print("No")
else:
    print("Yes")
    for i in range(n):
        for j in range(i):
            a.append(i+1)
    for i in range(n):
        for j in range(n-i-1):
            b.append(i+1)
    for i in range(n*n):
        if x.count(i+1)==1:
            ans.append(count)
            count+=1
        else:
            if count2<lena:
                ans.append(a[count2])
                count2+=1
            else:
                ans.append(b[count3])
                count3+=1
    print(*ans)
Problem p03962 (python)

Fixed submission:
a,b,c=input().split()
d=[a,b,c]
for i in range(2):
    if d.count(d[i])!=1:
        del d[i]
print(len(d))

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
d=list[a,b,c]
for i in range(2):
    if d.count(d[i])!=1:
        del d[i]
print(len(d))

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=list[a,b,c]
for i in range(2):
    if d.count(d[i])!=1:
        del d[i]
print(len(d))
Problem p02585 (python)

Fixed submission:
n,k = map(int,input().split())
pn = list(map(int,input().split()))
cn = list(map(int,input().split()))
ans = -float("inf")


for i in range(n): 
    start=i
    now=start
    total = 0 #ループ計
    ls = [0]

    for j in range(1, k+1):
        now = pn[now]-1
        total += cn[now]
        ans = max(ans, total)
        ls.append(total)
        if now == start:
            rp = j
            break
    else:
        continue  #roopなし

    if total <= 0:
        continue
    else:
        if k % rp == 0:
            ans2 = total * (k // rp-1) + max(ls)
            ans = max(ans, ans2)
        else:
            ans2 = total * (k//rp) + max(ls[:k%rp+1])
            ans = max(ans, ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
pn = list(map(int,input().split()))
cn = list(map(int,input().split()))
ans = -float("inf")


for i in range(n): 
    start=i
    now=start
    total = 0 #ループ計
    ls = [0]

    for j in range(1, k+1):
        now = pn[now]-1
        total += cn[now]
        ans = max(ans, total)
        ls.append(total)
        if now == start:
            rp = j
            break
    else:
        continue  #roopなし

    if total <= 0:
        continue
    else:
        if k % rp == 0:
            ans2 = total * (k // rp-1) + max(ls)
            ans = max(ans, ans2)
        else:

            ans2 = total * (k//rp) + max(ls[:s+1])
            ans = max(ans, ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
# n=int(input())
n,k=map(int,input().split())
P=list(map(int,input().split()))
P=[i-1 for i in P]
C=list(map(int,input().split()))
ans=-float("inf")
for i in range(n):
    dp=[-float("inf")]*(n+2)
    kai=0
    dp[kai]=C[P[i]]
    now=P[i]
    bef=i
    while now!=i:
        kai+=1
        if kai>=k:break
        dp[kai]= dp[kai-1]+C[P[now]]
        now=P[now]
    #if dp[0]==max(dp):dp[0]=-float("INF")

    if kai>=k: ans=max(ans,max(dp));continue
    kai+=1
    t=k%kai
    ans=max(ans, dp[kai-1]*(k//kai) + max(dp[:t]) )
    
print(ans)

Buggy submission (verdict: Runtime Error):
# n=int(input())
n,k=map(int,input().split())
P=list(map(int,input().split()))
P=[i-1 for i in P]
C=list(map(int,input().split()))
ans=-float("inf")
for i in range(n):
    dp=[-float("inf")]*(k+1)
    kai=0
    dp[kai]=C[P[i]]
    now=P[i]
    bef=i
    while 1:
        kai+=1
        if kai>=k:break
        dp[kai]= dp[kai-1]+C[P[now]]
        now=P[now]
    #if dp[0]==max(dp):dp[0]=-float("INF")
    ans=max(ans,max(dp))
print(ans)
Problem p02588 (python)

Fixed submission:
n=int(input())
from decimal import Decimal as D
# A=[]
excel=[[0]*20 for i in range(50)]
query=[]
for i in range(n):
    q=input()
    q=D(q)
    q=int(q*10**9)
    num2=0 ;num5=0
    k=q
    for i in range(50):
        if k%2==0:
            k//=2
            num2+=1
        else:break
    k=q
    for i in range(20):
        if k%5==0:
            k//=5
            num5+=1
        else:break
    excel[num2][num5]+=1
    query.append([max(0,18-num2),max(0,18-num5)])

A=[[0] * 20 for i in range(50)] #累積和
for i in range(49,-1,-1):
    for j in range(19,-1,-1):
        if i==49 and j==19:
            A[i][j]=excel[i][j]
        elif i==49:
            A[i][j]=A[i][j+1]+excel[i][j]
        elif j==19:
            A[i][j]=A[i+1][j] + excel[i][j]
        else:
            A[i][j]=excel[i][j]+ A[i+1][j]+A[i][j+1]-A[i+1][j+1]

ans=0
for l in query:
    num2,num5=l
    if num2<=9 and num5<=9:
        ans+=A[num2][num5]-1
    else:
        ans+=A[num2][num5]

#for i in range(50):
 #   print(excel[:][i] , A[:][i])
print(ans//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
from decimal import Decimal as D
# A=[]
excel=[[0]*20 for i in range(50)]
query=[]
for i in range(n):
    q=input()
    q=D(q)
    q=int(q*10**9)
    num2=0 ;num5=0
    k=q
    for i in range(50):
        if k%2==0:
            k//=2
            num2+=1
        else:break
    k=q
    for i in range(20):
        if k%5==0:
            k//=5
            num5+=1
        else:break
    excel[num2][num5]+=1
    query.append([max(0,18-num2),max(0,18-num5)])

A=[[0] * 20 for i in range(50)] #累積和
for i in range(49,-1,-1):
    for j in range(19,-1,-1):
        if i==49 and j==19:
            A[i][j]=excel[i][j]
        elif i==49:
            A[i][j]=A[i][j+1]+excel[i][j]
        elif j==19:
            A[i][j]=A[i+1][j] + excel[i][j]
        else:
            A[i][j]=excel[i][j]+ A[i+1][j]+A[i][j+1]-A[i+1][j+1]

ans=0
for l in query:
    num2,num5=l
    if num2<=9 and num5<=9:
        ans+=A[num2][num5]-1
    else:a
        ans+=A[num2][num5]

#for i in range(50):
 #   print(excel[:][i] , A[:][i])
print(ans//2)
Problem p02613 (python)

Fixed submission:
n=int(input())
from collections import Counter
A=[]
for i in range(n):
  A.append((input()))
C=Counter(A)
print(f"""AC x {C["AC"]}
WA x {C["WA"]}
TLE x {C["TLE"]}
RE x {C["RE"]}""")

Buggy submission (verdict: Runtime Error):
n=int(input())
from collections import Counter
A=[]
for i in range(n):
  A.append(int(input()))
C=Counter(A)
print(f"""AC x {C["AC"]}
WA x {C["WA"]}
TLE x {C["TLE"]}
RE x {C["RE"]}""")
Problem p02621 (python)

Fixed submission:
a=int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(a+a**2+a**3)
Problem p02642 (python)

Fixed submission:
n=int(input())
A=sorted(list(map(int,input().split())))
B=[0]*(1+A[-1])
for i in A:
    B[i]+=1
    if B[i]==1:
        for j in range(2*i,A[-1]+1,i):
            B[j]+=1
    else:
        continue
ans=0
for i in A:
  if B[i]==1: ans+=1

print(ans)

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

A.sort()
B=[1]*n

from math import sqrt
def eratosu():
  # if not isinstance(n,int):
  #   raise TypeError("nがint型になってねえぞ")
  # if n<2:
  #   raise ValueError('nが2よりちっちぇえぞ')
  primec = 0
  # limit = sqrt(n)
  data = A  #2,3,4,...,n
  while len(data)>0:
    p = data[0]
    # if limit <= p:
    #     return prime + data
    if len(data)>0:
        if data[1]==p:
            primec-=1
    primec+=1 
    data = [e  for e in data if e % p != 0]
  return primec 

# for i in range(n):
#     if i>0:
#         if A[i]==A[i-1]: B[i]=0 ; B[i-1]=0 ; continue
    # if B[i]==1:
    #     for j in range(i+1,n):
    #         if A[j]%A[i]==0:
    #             B[j]=0
print(eratosu())

# print(sum(B))
Problem p02686 (python)

Fixed submission:
import sys
input=lambda: sys.stdin.readline().strip()


n=int(input())
A=[]
#
PM=[[0,0] for i in range(n)]
for i in range(n):
    now=0
    mini=0
    for j in input():
        if j=="(": now+=1 
        else:
            now-=1 ; mini=min(mini,now)
    PM[i]=[mini,now]

if sum( [PM[i][1] for i in range(n)]  )!=0 : 
    print("No")
    exit()

MINI=0
NOW=0
PMf=[PM[i] for i in range(n) if PM[i][1]>=0]
PMf.sort()
for i in range(len(PMf)):
    MINI=min(MINI , NOW+PMf[-i-1][0] )
    NOW+=PMf[-i-1][1]
    if MINI<0 : print("No") ; exit()

PMs=[PM[i] for i in range(n) if PM[i][1]<0]
PMs=sorted(PMs , key=lambda x : x[1]-x[0])
for i in range(len(PMs)):
    MINI=min(MINI , NOW+PMs[-i-1][0] )
    NOW+=PMs[-i-1][1]
    if MINI<0 : print("No") ; exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
import math
import heapq
mod=10**9+7
inf=float("inf")
from math import sqrt
from collections import deque
from collections import Counter
from math import ceil
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from functools import lru_cache
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########

A=list(map(int,input().split()))
n=len(A)
PM=[[0,0] for i in range(n)]
for i in range(n):
    now=0
    mini=0
    for j in A[i]:
        if j=="(": now+=1 
        else:
            now-=1 ; mini=min(mini,now)
    PM[i]=[mini,now]

if sum([PM[i][1] for i in range(n)]  )!=0 : 
    print("No")
    exit()

MINI=0
NOW=0
PMf=[PM[i] for i in range(n) if PM[i][1]>=0]
PMf.sort()
for i in range(len(PMf)):
    MINI=min(MINI , NOW+PMf[-i-1][0] )
    NOW+=PMf[-i-1][1]
    if MINI<0 : print("No") ; exit()

PMs=[PM[i] for i in range(n) if PM[i][1]<0]
PMs=sorted(PMs , key=lambda x : x[1]-x[0])
for i in range(len(PMs)):
    MINI=min(MINI , NOW+PMs[-i-1][0] )
    NOW+=PMs[-i-1][1]
    if MINI<0 : print("No") ; exit()

print("Yes")
Problem p02748 (python)

Fixed submission:
a,b,m=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=min(A)+min(B)
for _ in range(m):
    i,j,c=map(int,input().split())
    ans=min(ans, A[i-1]+B[j-1]-c)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,m=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=1162513825187421
for _ in range(m):
    i,j,c=map(int,input().split())
    ans=min(ans, A[i-1]+B[i-1]-c)
print(ans)
Problem p02755 (python)

Fixed submission:
import math
a,b=map(int,input().split())
a1=math.ceil(a/0.08)
a2=math.floor((a+1)/0.08)
A=set([i for i in range(a1,a2)])
b1=math.ceil(b/0.1)
b2=math.floor((b+1)/0.1)
B=set([i for  i in range(b1,b2)])

if A&B==set(): 
    print(-1)
    exit()

print(min(A & B))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
a1=int(a/0.08+0.00001)
a2=int((a+1)/0.08-0.000001)
A=set([i for  i in range(a1,a2+1)])
b1=int(b/0.1+0.00001)
b2=int((b+1)/0.1-0.000001)
B=set([i for  i in range(b1,b2+1)])

print(min(A & B))
Problem p02760 (python)

Fixed submission:
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
n=int(input())
ans=[[0,0,0] for i in range(3)]

for i in range(n):
  s=int(input())
  count=-1
  for T in [A,B,C]:
    count+=1
    if s in T:
      
      ans[count][T.index(s)]=1
for i in range(3):
  if ans[i]==[1,1,1]:
    print("Yes")
    exit()
for i in range(3):
  if [ans[j][i] for j in range(3)]==[1,1,1]:
    print("Yes")
    exit()
if [ans[0][0],ans[1][1],ans[2][2]]==[1,1,1]:
  print("Yes")
  exit()
if [ans[0][2],ans[1][1],ans[2][0]]==[1,1,1]:
  print("Yes")
  exit()
print("No")

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
n=int(input())
ans=[[0,0,0] for i in range(3)]
count=-1
for i in range(n):
  s=int(input())
  for T in [A,B,C]:
    count+=1
    if s in T:
      ans[count][T.index(s)]=1
for i in range(3):
  if ans[i]==[1,1,1]:
    print("Yes")
    exit()
for i in range(3):
  if [ans[i][j] for j in range(3)]==[1,1,1]:
    print("Yes")
    exit()
if [ans[0][0],ans[1][1],ans[2][2]]==[1,1,1]:
  print("Yes")
  exit()
if [ans[0][2],ans[1][1],ans[2][0]]==[1,1,1]:
  print("Yes")
  exit()
print("No")

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
n=int(input())
ans=[[0,0,0] for i in range(3)]
for i in range(n):
  s=int(input())
  for T in [A,B,C]:
    if s in T:
      ans[T.index(s)]=1
for i in range(3):
  if ans[i]==[1,1,1]:
    print("Yes")
    exit()
for i in range(3):
  if [ans[i][j] for j in range(3)]==[1,1,1]:
    print("Yes")
    exit()
if [ans[0][0],ans[1][1],ans[2][2]]==[1,1,1]:
  print("Yes")
  exit()
if [ans[0][2],ans[1][1],ans[2][0]]==[1,1,1]:
  print("Yes")
  exit()
print("No")