Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
count=0
A=0
B=0
BA=0
for i in range(n):
    for j in range(len(s[i])-1):
        if j==0:
            if s[i][j]=='B':
                B+=1
        if j==len(s[i])-2:
            if s[i][j+1]=='A':
                A+=1
        if s[i][j:j+2]=='AB':
            count+=1
    if s[i][0]=='B' and s[i][-1]=='A':
        BA+=1
        A-=1
        B-=1
        
if BA==0:
    print(count+min(A,B))
else:
    ans=count+BA-1
    if A>=1 and B>=1:
        print(ans+2)
    elif A>=1 or B>=1:
        print(ans+1)
    else:
        print(ans)

Fixed submission:
import math
n=int(input())

x=n**0.5

if x-x//1!=0:
    x=int(x//1)
else:
    x=int(x//1)-1
y=0

for i in range(1,x+1):
    if (n-i)/i-(n-i)//i==0:
        if int((n-i)//i)!=i:
            y+=int((n-i)//i)

print(y)

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in range(n):
    if i**2>=n:
        x=i
        break

for i in range(1,x):
    if n%i==0:
        ans+=n//i-1
print(ans)

Fixed submission:
import math
n=int(input())

x=n**0.5

if x-x//1!=0:
    x=int(x//1)
else:
    x=int(x//1)-1
y=0

for i in range(1,x+1):
    if (n-i)/i-(n-i)//i==0:
        if int((n-i)//i)!=i:
            y+=int((n-i)//i)

print(y)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b= int(input())
c = int(input())
x= int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500+j*100+k*50==x:
        ans+=1
print(ans)

Fixed submission:
A,B,T=map(int, input().split())
print(T//A*B)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans = a[i]-b[i]
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans += a[i]-b[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import itertools

n=int(input())
s=list(input())
v=list(reversed(s))
ans=float('inf')
s1=[]

s=itertools.accumulate(s)
v=itertools.accumulate(v)
s=['']+list(s)
v=['']+list(v)

for i in range(n):
    cnt=s[i].count('#')+v[-(i+1)].count('.')
    ans=min(cnt,ans)
print(ans)


    

    
        
        
        
    
                
    
        

     

    

     

    


Fixed submission:
import itertools

n=int(input())
s=list(input())
a=s.count('#')
b=0
ans=a

for i in range(1,n+1):
    if s[-i]=='.':
        b+=1
    else:
        a-=1
        
    ans=min(a+b,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

m = a[0]
k = b[0]
for i in range(n):
    if a[i] >b[i] :
        ans += a[i]-b[i]
print(ans)

Fixed submission:
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A=B:
  print(2*A)
else:
  print(2*B-1)

Fixed submission:
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A=B:
  print(2*A-2)
else:
  print(2*B-1)
  


Fixed submission:
A,B=map(int, input().split())
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**9)

x,y,z,k=map(int, input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
c=list(map(int, input().split()))

ans1=[]
ans2=[]

for i in range(x):
    for j in range(y):
        ans1.append(a[i]+b[j])
ans1.sort()
ans1.reverse()

if len(ans1)>=k:
    del ans1[k:]
    
for i in range(len(ans1)):
    for j in range(z):
        ans2.append(ans1[i]+c[j])
ans2.sort()
ans2.reverse()

for i in range(k):
    print(ans2[i])


            
            
    

        

    
    


        
    

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a>k:
  print(':(')
else:
  print('Yay!')
Buggy python submission (verdict: Runtime Error):
n = int(input())
mod = 10**9+7
 
dp = [[[[0]*4 for _ in range(4)] for _ in range(4)] for _ in range(n+1)]
#長さ0の文字列は1
#0,1,2(A,G,C)に関する制約しかないため
#Sは、TTTSと考えてもよい
dp[0][3][3][3] = 1
 
#swapしてAGCが発生しない文字列:=AGC,ACG,GAC,A?GC,AG?Cを含まない文字列
#A:=0,G:=1,C:=2,T:=3
 
#文字列の文字数
for i in range(n):
    #最後から1文字目
    for j in range(4):
        #最後から2文字目
        for k in range(4):
            #条件に当てはまるものがない場合
            if dp[i][j][k] == 0:
                continue
            #最後から3文字目
            for l in range(4):
                #新たに追加する文字
                for a in range(4):
                    #ダメな5条件をカット
 
                    #AGCの場合
                    if a == 2 and j == 1 and k == 0:continue
                    #GACの場合
                    if a == 2 and j == 0 and k == 1:continue
                    #ACGの場合
                    if a == 1 and j == 2 and k == 0:continue
                    #A?GCの場合
                    if a == 2 and j == 1 and l == 0:continue
                    #AG?Cの場合
                    if a == 2 and k == 1 and l == 0:continue
 
                    #ダメの条件を抜けると、aを足した文字列が作れる
                    dp[i+1][a][j][k] += dp[i][j][k][l]
                    dp[i+1][a][j][k] %= mod
 
ans = 0
for j in range(4):
    for k in range(4):
        for l in range(4):
            #長さnの全通り回収
            ans += dp[n][j][k][l]
            ans %= mod
print(ans)

Fixed submission:
n=input()
if n=='A':
    print('T')
elif n=='G':
    print('C')
elif n=='T':
    print('A')
else:
    print('G')

Buggy python submission (verdict: Runtime Error):
b=int(input())

if input()==A:
  print('T')
elif input()==T:
  print('A')
elif input()==C:
  print('G')
else:
  print('C')

Fixed submission:
n=input()
if n=='A':
    print('T')
elif n=='G':
    print('C')
elif n=='T':
    print('A')
else:
    print('G')
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
for i in range(n-1):
    if s[i]=='A':
        if s[i+1]=='C':
            r[i+1]=1
        else:
            pass
for i in range(q):
    print(sum(r[:v[i][1]])-sum(r[:v[i][0]]))

Fixed submission:
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
a=0
for i in range(n-1):
    r[i]=a
    if s[i]=='A':
        if s[i+1]=='C':
            a+=1
        else:
            pass
r[n-1]=a
for i in range(q):
    print(r[v[i][1]-1]-r[v[i][0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
for i in range(n-1):
    if s[i]=='A':
        if s[i+1]=='C':
            r[i+1]=1
        else:
            pass
for i in range(q):
    print(sum(r[:v[i][1]])-sum(r[:v[i][0]]))

Fixed submission:
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
a=0
for i in range(n-1):
    r[i]=a
    if s[i]=='A':
        if s[i+1]=='C':
            a+=1
        else:
            pass
r[n-1]=a
for i in range(q):
    print(r[v[i][1]-1]-r[v[i][0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
count=0
for i in range(q):
    for j in range(v[i][0]-1,v[i][1]-1):
        if s[j]=='A':
            if s[j+1]=='C':
                count+=1
            else:
                pass
    print(count)
    count=0

Fixed submission:
n,q=map(int,input().split())
s=input()
v=[list(map(int,input().split())) for i in range(q)]
r=[0]*n
count=0
a=0
for i in range(n-1):
    r[i]=a
    if s[i]=='A':
        if s[i+1]=='C':
            a+=1
        else:
            pass
r[n-1]=a
for i in range(q):
    print(r[v[i][1]-1]-r[v[i][0]-1])
Buggy python submission (verdict: Runtime Error):
A,B,K = list(map(int, input().split()))
x=[]

for i in range(max(A,B)):
  if A%i==B%i==0:
    x.append(i)

print(x[K-1])

Fixed submission:
A,B,K = list(map(int, input().split()))
x=[]
count=0 
for i in range(max(A,B)+1):
  if A%(i+1)==B%(i+1)==0:
    x.append(i+1)
    count+=1
 
print(x[count-K])
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[int(input()) for i in range(n)]
 
print(sum(s)-max(s)//2)

Fixed submission:
n,m=map(int, input().split())
a= [list(map(int,input().split())) for i in range(n)]
for i in range(n):
    del a[i][0]
v=[]

x=0
for i in range(1,m+1):
    for j in range(n):
        v.append(a[j].count(i))

for i in range(0,m*n,n):
  
    if v[i:i+n].count(1)==n:
        x+=1

  
print(x)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
a=list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = math.gcd(ans, a[i])
print(ans)

Fixed submission:
import fractions
n=int(input())
a=list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = fractions.gcd(ans, a[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
x=bin(k)[2:]

ans=0
flag=True

for i in range(50):
    count=0
    for j in range(n):
        if (a[j]>>(50-i-1))&1==1:
            count+=1

    if 50-i>len(x):
        ans+=（2**(50-i-1)）*count

    elif not flag:
        ans+=（2**(50-i-1)）*max(count, n-count)
    else:
        if 2*count>=n:
            if int(x[-(50 - i)]) == 1:
                ans+=（2**(50-i-1)）*count
                flag=False
            else:
                ans +=（ 2 ** (50 - i - 1)） * count

        else:
            if int(x[-(50-i)])==1:
                ans+=（2**(50-i-1)）*(n-count)
            else:
                ans+=（2**(50-i-1)）*count
      

print(ans)


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
x=bin(k)[2:]

ans=0
flag=True

for i in range(50):
    count=0
    for j in range(n):
        if (a[j]>>(50-i-1))&1==1:
            count+=1

    if 50-i-1>len(x)-1:
        ans+=2**(50-i-1)*count

    elif not flag:
        ans+=2**(50-i-1)*max(count, n-count)
    else:
        if 2*count>=n:
            if int(x[-(50 - i)]) == 1:
                ans+=2**(50-i-1)*count
                flag=False
            else:
                ans += 2 ** (50 - i - 1) * count
        
        else:
            if int(x[-(50-i)])==1:
                ans+=2**(50-i-1)*(n-count)
            else:
                ans+=2**(50-i-1)*count

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
x=bin(k)[2:]

ans=0
flag=True

for i in range(50):
    count=0
    for j in range(n):
        if (a[j]>>(50-i-1))&1==1:
            count+=1

    if 50-i>len(x):
        ans+=（2**(50-i-1)）*count

    elif not flag:
        ans+=（2**(50-i-1)）*max(count, n-count)
    else:
        if 2*count>=n:
            if int(x[-(50 - i)]) == 1:
                ans+=（2**(50-i-1)）*count
                flag=False
            else:
                ans +=（ 2 ** (50 - i - 1)） * count

        else:
            if int(x[-(50-i)])==1:
                ans+=（2**(50-i-1)）*(n-count)
            else:
                ans+=（2**(50-i-1)）*count
                flag=False

print(ans)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
x=bin(k)[2:]

ans=0
flag=True

for i in range(50):
    count=0
    for j in range(n):
        if (a[j]>>(50-i-1))&1==1:
            count+=1

    if 50-i-1>len(x)-1:
        ans+=2**(50-i-1)*count

    elif not flag:
        ans+=2**(50-i-1)*max(count, n-count)
    else:
        if 2*count>=n:
            if int(x[-(50 - i)]) == 1:
                ans+=2**(50-i-1)*count
                flag=False
            else:
                ans += 2 ** (50 - i - 1) * count
        
        else:
            if int(x[-(50-i)])==1:
                ans+=2**(50-i-1)*(n-count)
            else:
                ans+=2**(50-i-1)*count

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
h=list(map(int, input().split()))
v=[]
dp=[0]*(n)
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    for j in range(1,k+1):
        if i-j<0:
            break
        v.append(abs(h[i]-h[i-j])+dp[i-j])
    dp[i]=min(v)
    v=[]
        
        
print(dp[n-1])

Fixed submission:
n,k=map(int, input().split())
h=list(map(int, input().split()))
v=[]
dp=[0]*(n)
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    for j in range(1,k+1):
        if i-j<0:
            break
        v.append(abs(h[i]-h[i-j])+dp[i-j])
    dp[i]=min(v)
    v=[]
        
        
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=sys.stdin.readline
s=' '+input().rstrip()
t=' '+input().rstrip()
m=len(s)-1
n=len(t)-1
dp=[[0]*(n+1) for i in range(m+1)]
for i in range(1,m+1):
    for j in range(1,n+1):
        if s[i]==t[j]:
            dp[i][j]=dp[i-1][j-1]+1
        else:
            dp[i][j]=max(dp[i-1][j],dp[i][j-1])
ans=''
while m>0 and n>0:
    if dp[m][n]==dp[m][n-1]:
        n-=1
    elif dp[m][n]==dp[m-1][n]:
        m-=1
    elif dp[m][n]==dp[m-1][n-1]+1:
        ans=s[m]+ans
        m-=1
        n-=1
print(ans)

Fixed submission:
import sys
input=sys.stdin.readline
s=' '+input().rstrip()
t=' '+input().rstrip()
m=len(s)-1
n=len(t)-1
dp=[[0]*(n+1) for i in range(m+1)]
for i in range(1,m+1):
    for j in range(1,n+1):
        if s[i]==t[j]:
            dp[i][j]=dp[i-1][j-1]+1
        else:
            dp[i][j]=max(dp[i-1][j],dp[i][j-1])
ans=''
while m>0 and n>0:
    if dp[m][n]==dp[m][n-1]:
        n-=1
    elif dp[m][n]==dp[m-1][n]:
        m-=1
    elif dp[m][n]==dp[m-1][n-1]+1:
        ans=s[m]+ans
        m-=1
        n-=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(float, input().split()))
ans=0
dp=[[0]*(n+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n+1):
    for j in range(1,n+1):
        if i==0:
            dp[i][j]=dp[i][j-1]*(1-p[j-1])
        else:
            dp[i][j]=p[j-1]*dp[i-1][j-1]+(1-p[j-1])*dp[i][j-1]

for i in range(n//2+1,n+1):
    ans+=dp[i][n]
print(ans)

Fixed submission:
n=int(input())
p=list(map(float, input().split()))
ans=0
dp=[[0]*(n+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n+1):
    for j in range(1,n+1):
        if i==0:
            dp[i][j]=dp[i][j-1]*(1-p[j-1])
        else:
            dp[i][j]=p[j-1]*dp[i-1][j-1]+(1-p[j-1])*dp[i][j-1]

for i in range(n//2+1,n+1):
    ans+=dp[i][n]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int, input().split())
a=list(map(int, input().split()))
x=[1]
dp=[0]*(k+1)
#先手勝利1

for i in range(1,k+1):
    for j in range(n):
        if i>=a[j]:
            x.append(dp[i-a[j]])
    if min(x)==0:
        dp[i]=1
    else:
        dp[i]=0
    x=[1]
if dp[k]==1:
    print('First')
else:
    print('Second')

Fixed submission:
n,k=map(int, input().split())
a=list(map(int, input().split()))
x=[1]
dp=[0]*(k+1)
#先手勝利1

for i in range(1,k+1):
    for j in range(n):
        if i>=a[j]:
            x.append(dp[i-a[j]])
    if min(x)==0:
        dp[i]=1
    else:
        dp[i]=0
    x=[1]
if dp[k]==1:
    print('First')
else:
    print('Second')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a= list(map(int, input().split()))
a+=a
INF=10**12
dp=[[[INF,0] for i in range(2*n+1)] for i in range(2*n+1)]
# dp[i][j][0]: コスト
# dp[i][j][1]:合成したスライムの合計

for i in range(n):
    for l in range(2*n-i):
        r=l+i
        if r==l:
            dp[l][r][1]=a[l]
            dp[l][r][0]=0
        else:
            # 合成の仕方を確定
            for k in range(l,r):
                dp[l][r][0]=min(dp[l][k][1]+dp[k+1][r][1]+dp[l][k][0]+dp[k+1][r][0],dp[l][r][0])
            dp[l][r][1]=dp[l][r-1][1]+a[r]
print(dp[0][n-1][0])

Fixed submission:
import sys
import itertools
input = sys.stdin.readline


n=int(input())
a=list(map(int, input().split()))
b=itertools.accumulate(a)
b=[0]+list(b)
dp=[[0]*(n) for i in range(n)]

x=float('inf')
for i in range(n-1,-1,-1):
    for j in range(i+1,n):
        if j>=i+2:
            for k in range(i,j):
                x=min(dp[i][k]+dp[k+1][j],x)
            dp[i][j]=x+(b[j+1]-b[i])
            x=float('inf')
        else:
            dp[i][j]=b[j+1]-b[i]
print(dp[0][-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[list(map(int,list(input()))) for i in range(h)]

print(sum(s)-1/2max(s))

Fixed submission:
n=int(input())
s=[int(input()) for i in range(n)]
 
print(sum(s)-max(s)//2)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
v=[]
for i in range(n-m+1):
    a=min(h[i:m+i])
    b=max(h[i:m+i])
    v.append(b-a)
print(min(v))

Fixed submission:
n,m=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
v=[]
for i in range(n-m+1):
    a=h[i]
    b=h[i+m-1]
    v.append(b-a)
    
print(min(v))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
v=[]
for i in range(n-m+1):
    a=min(h[i:m+i])
    b=max(h[i:m+i])
    v.append(b-a)
print(min(v))

Fixed submission:
n,m=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
v=[]
for i in range(n-m+1):
    a=h[i]
    b=h[i+m-1]
    v.append(b-a)
    
print(min(v))
Buggy python submission (verdict: Runtime Error):
import itertools

n=int(input())
a=list(int(input()) for i in range(n))
b=[]
a.sort()

ans=0

if n%2==1:
    b.append(a[n//2])
    for i in range(n//2):
        if a[n//2]-a[0]<=a[-1]- a[n//2]:
            b.append(a[-(i+1)])
            b.append(a[i])
        else:
            b.append(a[i])
            b.append(a[-(i+1)])
            
        
    for i in range(len(b)-1):
        ans+=abs(b[i+1]-b[i])
    print(ans)


else:
    b.append(a[n//2-1])
    b.append(a[n//2+1])
    
    if n==2:
        print(b[1]-b[0])
        exit()
    
    for i in range(n//2-2):
        b.append(a[i])
        b.append(a[-(i+1)])
    
    b.append(a[n//2-2])
    b.append(a[n//2])
    
    for i in range(len(b)-1):
        ans+=abs(b[i+1]-b[i])
    print(ans)
        
        
        
        
        




Fixed submission:
import itertools

n=int(input())
a=list(int(input()) for i in range(n))
b=[]
a.sort()
ans=0

if n%2==1:
    x=2*sum(a[n//2+1:])-2*sum(a[:n//2+1])+sum(a[n//2-1:n//2+1])
    y=2*sum(a[n//2:])-sum(a[n//2:n//2+2])-2*sum(a[:n//2])
    print(max(x,y))

else:
    x=2*sum(a[n//2:])-(a[n//2]) -2*sum(a[:n//2])+a[n//2-1]
    print(x)
Buggy python submission (verdict: Runtime Error):
n=int(input())
z=[list(map(int, input().split())) for i in range(n)]
z.sort(key=lambda x:x[2])
z.reverse()
print(z)

v=[]
count=0

#各頂点に対して、中心座標と仮定して検証
for i in range(101):
    for j in range(101):
            x=abs(j-z[0][0])
            y=abs(i-z[0][1])
            h=z[0][2]+abs(x)+abs(y)
                
            #候補があってるか確認
            for k in range(n):
                if z[k][2]==max(h-abs(z[k][0]-j)-abs(z[k][1]-i),0):
                    count+=1
                
            if count==n:
                print(r[0],r[1],h)
            exit()
        count=0

Fixed submission:
n=int(input())
z=[list(map(int, input().split())) for i in range(n)]
z.sort(key=lambda x:x[2])
z.reverse()

v=[]
count=0

#各頂点に対して、中心座標と仮定して検証
for i in range(101):
    for j in range(101):
        x=abs(j-z[0][0])
        y=abs(i-z[0][1])
        h=z[0][2]+abs(x)+abs(y)
                
            #候補があってるか確認
        for k in range(n):
            if z[k][2]==max(h-abs(z[k][0]-j)-abs(z[k][1]-i),0):
                count+=1
                
        if count==n:
            print(j,i,h)
            exit()
        count=0

Buggy python submission (verdict: Runtime Error):
import fractions
n=int(input())
a=list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = fractions.gcd(ans, a[i])
print(ans)

Fixed submission:
n=int(input())
z=[list(map(int, input().split())) for i in range(n)]
z.sort(key=lambda x:x[2])
z.reverse()

v=[]
count=0

#各頂点に対して、中心座標と仮定して検証
for i in range(101):
    for j in range(101):
        x=abs(j-z[0][0])
        y=abs(i-z[0][1])
        h=z[0][2]+abs(x)+abs(y)
                
            #候補があってるか確認
        for k in range(n):
            if z[k][2]==max(h-abs(z[k][0]-j)-abs(z[k][1]-i),0):
                count+=1
                
        if count==n:
            print(j,i,h)
            exit()
        count=0

Buggy python submission (verdict: Runtime Error):
n=int(input())
z=[list(map(int, input().split())) for i in range(n)]
v=[]
r=[]
#各頂点に対して、ピラミッドの頂点(  高さ200 )と仮定して計算 rに座標保存
for i in range(101):
    for j in range(101):
        for k in range(n):
            x=abs(j-z[k][0])
            y=abs(i-z[k][1])
            v.append(200-x-y-z[k][2])
        if v.count(v[0])==n:
            r=[j,i]
        v=[]
#中心座標の高さを求める。
h=z[0][2]+abs(z[0][0]-r[0])+abs(z[0][1]-r[1])
print(r[0],r[1],h)

Fixed submission:
n=int(input())
z=[list(map(int, input().split())) for i in range(n)]
z.sort(key=lambda x:x[2])
z.reverse()

v=[]
count=0

#各頂点に対して、中心座標と仮定して検証
for i in range(101):
    for j in range(101):
        x=abs(j-z[0][0])
        y=abs(i-z[0][1])
        h=z[0][2]+abs(x)+abs(y)
                
            #候補があってるか確認
        for k in range(n):
            if z[k][2]==max(h-abs(z[k][0]-j)-abs(z[k][1]-i),0):
                count+=1
                
        if count==n:
            print(j,i,h)
            exit()
        count=0
Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
v=list(map(int, input().split()))
v1=v[0:n:2]
v2=v[1:n:2]
v10=collections.Counter(v1)
v11=v10.most_common()
v20=collections.Counter(v2)
v21=v20.most_common()
if v11[0][0]==v21[0][0] and v11[0][1]==n//2 and v21[0][1]==n//2:
    print(n//2)
elif v11[0][0]==v21[0][0]:
    x1=n//2-v11[0][1]
    x2=n//2-v11[1][1]
    y1=n//2-v21[0][1]
    y2=n//2-v21[1][1]
    print(min(x1+y2,x2+y1))
    
else:
    x=n//2-v11[0][1]
    y=n//2-v21[0][1]
    print(x1+y1)

Fixed submission:
import collections
n=int(input())
v=list(map(int, input().split()))
v1=v[0:n:2]
v2=v[1:n:2]
v10=collections.Counter(v1)
v11=v10.most_common()
v20=collections.Counter(v2)
v21=v20.most_common()
if v11[0][0]==v21[0][0] and v11[0][1]==n//2 and v21[0][1]==n//2:
    print(n//2)
elif v11[0][0]==v21[0][0]:
    x1=n//2-v11[0][1]
    x2=n//2-v11[1][1]
    y1=n//2-v21[0][1]
    y2=n//2-v21[1][1]
    print(min(x1+y2,x2+y1))
    
else:
    x1=n//2-v11[0][1]
    y1=n//2-v21[0][1]
    print(x1+y1)
Buggy python submission (verdict: Runtime Error):
A,B=int(input()) 
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
A,B=int(input()) 
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
A=int() , B=int()
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
int A, int B
x=A*B
if x%2==0:
  print('Yes')
else:
  print('No')

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
int A, int B
x=A*B
if x%2==0:
  return 'Yes'
else:
  returun 'No'

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
input(A,B)
x=A*B
if x%2==0:
  return 'Yes'
else:
  returun 'No'

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
if A%2==0 or B%2==0:
  return 'Yes'
else:
  return 'No'

Fixed submission:
A,B=list(map(int,input().split()))
x=A*B
if x%2==0:
  print('No')
else:
  print('Yes')