Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
import math
num = math.factorial(n)
ans = 0
for i in range(1,num+1):
  if num%i==0:
    ans+=1
print(ans%(10**9+7))

Fixed submission:
n = int(input())
import math
num = math.factorial(n)
dic={}
i = 2
ans = 1
while num != 1:
  cnt = 1
  while num%i == 0:
    num = num//i
    cnt+=1
  ans = ans*cnt
  i +=1
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
import math
num = math.factorial(n)
ans = 0
for i in range(1,num+1):
  if num%i==0:
    ans+=1
print(ans)

Fixed submission:
n = int(input())
import math
num = math.factorial(n)
dic={}
i = 2
ans = 1
while num != 1:
  cnt = 1
  while num%i == 0:
    num = num//i
    cnt+=1
  ans = ans*cnt
  i +=1
print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
k,s=map(int,input().split())
print(len([z for x in range(k+1) for y in range(k+1) if 0<=s-x-y<=k]))

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Runtime Error):
s,k=map(int,input().split())
print(len([z for x in range(0,k+1) for y in range(0,k+1) if 0<=s-x-y<=k]))

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Runtime Error):
s,k=map(int,input().split())
print(len[z for x in range(0,k+1) for y in range(0,k+1) if 0<=s-x-y<=k])

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())
import math
if K>=S:
  print(math.factorial(S+1))
else:
  count=0
  for i in range(0,K+1):
    for j in range(0,K+1):
      for h in range(0,K+1):
        if i+j+h==S:
          count+=1
print(count)

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
count=0
for i in range(0,K+1):
  for j in range(0,K+1):
    for h in range(0,K+1):
      if i+j+h==S:
        count+=1
print(count)

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))
Buggy python submission (verdict: Runtime Error):
print(eval(input())

Fixed submission:
print(eval(input()))
Buggy python submission (verdict: Runtime Error):
n = str(input())
if n = "a" or "i" or "u" or "e" or "o":
  print("vowe")
else:
  print("consonant")

Fixed submission:
n = str(input())
if n == "a" or n =="i" or n =="u" or n =="e" or n =="o":
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):
x = list(map(int,input().split()))
y = sorted(x)
if y[0]+y[1]=y[2]:
  print("Yes")
else:
  print("No")

Fixed submission:
x = list(map(int,input().split()))
y = sorted(x)
if y[0]+y[1]==y[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
gr = itertools.groupby(n)
print(len(gr)-1)

Fixed submission:
from itertools import groupby
print(len(list(groupby(input())))-1)
Buggy python submission (verdict: Runtime Error):
n = input()
l = len(n)
ans = 0
for i in range(l):
  for j in range(l-i):
    ans+=int(n[i]) * 10**j * 2**i * 2**(n-i-j-2)
print(ans)

Fixed submission:
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)
Buggy python submission (verdict: Runtime Error):
N,K,X,Y=input().split()
print((K*X+(N-K)*Y) if N>=K else N*X)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n >= k:
  print(k*x+(n-k)*y)
else:
  print(n*x)
Buggy python submission (verdict: Runtime Error):
n = input()
dic = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
for i in range(26):
  if n.count(str(dic[i]))%2!=0:
    print("No")
    exit()
print("Yes")

Fixed submission:
n = input()
dic = 'abcdefghijklmnopqrstuvwxyz'
for i in range(26):
  if n.count(str(dic[i]))%2!=0:
    print("No")
    exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = input()
dic = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
for i in range(26):
  if n.count(dic[i])%2!=0:
    print("No")
    exit()
print("Yes")

Fixed submission:
n = input()
dic = 'abcdefghijklmnopqrstuvwxyz'
for i in range(26):
  if n.count(str(dic[i]))%2!=0:
    print("No")
    exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
n = input()
a = ""
for i in range(n):
  if i =="0":
    a+=i
  elif i =="1":
    a+=i
  elif i =="B":
    a = a[:-1]
print(a)

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

Buggy python submission (verdict: Runtime Error):
n = input()
a = []
for i in range(n):
  if i =="0":
    a.append("0")
  elif i =="1":
    a.append("1")
  elif i =="B":
    a.pop()
print(*a)

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

Buggy python submission (verdict: Runtime Error):
n = input()
a = ""
for i in range(n):
  if i =="0":
    a.append(0)
  elif i =="1":
    a.append(1)
  elif i =="B":
    a.pop()
print(a)

Fixed submission:
n = input()
a = ""
for i in n:
  if i =="0":
    a+=i
  elif i =="1":
    a+=i
  elif i =="B":
    a = a[:-1]
print(a)
Buggy python submission (verdict: Runtime Error):
N = input()
print(N**3)

Fixed submission:
N = int(input())
print(N**3)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N = map(int, input().split())
if N % 2 == 1:
   print((N+1)/2)
else:
    print(N/2)



Fixed submission:
N = int(input())
if N % 2 == 1:
    print(int((N+1)/2))
else:
    print(int(N/2))

Buggy python submission (verdict: Runtime Error):
N=map(int, input().split())
if N % 2 == 1:
   print((N+1)/2)
else:
    print(N/2)



Fixed submission:
N = int(input())
if N % 2 == 1:
    print(int((N+1)/2))
else:
    print(int(N/2))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
print((A+B)*C)


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

print(int((A+B)*C/2))
Buggy python submission (verdict: Time Limit Exceeded):
import fractions as f

N = int(input())

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

rightGCD = []
leftGCD = []

rightGCD.append(0)
tmp = 0
for x in A[:-1:]:
    tmp = f.gcd(tmp,x)
    rightGCD.append(tmp)

leftGCD.insert(0,0)
tmp = 0
for x in A[:0:-1]:
    tmp = f.gcd(tmp,x)
    leftGCD.insert(0,tmp)

#print(leftGCD)
#print(rightGCD)

ans = 0

for i in range(N):
    if i==0:
        ans = max(ans,leftGCD[i])
        continue
    if i==N-1:
        ans = max(ans,rightGCD[i])
        continue

    ans = max(ans,f.gcd(rightGCD[i],leftGCD[i]))

print(ans)


Fixed submission:
import fractions as f

N = int(input())

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

rightGCD = [0]*N
leftGCD = [0]*N

for i in range(N-1):
    leftGCD[i+1] = f.gcd(leftGCD[i],A[i])
    rightGCD[-i-2] = f.gcd(rightGCD[-i-1],A[-i-1])

#print(leftGCD)
#print(rightGCD)

ans = 0

for i in range(N):
    ans = max(ans,f.gcd(rightGCD[i],leftGCD[i]))

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions as f

N = int(input())

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

rightGCD = []
leftGCD = []

rightGCD.append(0)
rightGCD.append(A[0])
tmp = A[0]
for x in A[2:]:
    tmp = f.gcd(tmp,x)
    rightGCD.append(tmp)

leftGCD.insert(0,0)
leftGCD.insert(0,A[-1])
tmp = A[-1]
for x in A[1:N-3:-1]:
    tmp = f.gcd(tmp,x)
    leftGCD.insert(0,tmp)

ans = 0

for i in range(N):
    if i==0:
        ans = max(ans,leftGCD[i])
        continue
    if i==N-1:
        ans = max(ans,rightGCD[i])
        continue

    ans = max(ans,f.gcd(rightGCD[i],leftGCD[i]))

#print(leftGCD)
#print(rightGCD)
print(ans)


Fixed submission:
import fractions as f

N = int(input())

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

rightGCD = [0]*N
leftGCD = [0]*N

for i in range(N-1):
    leftGCD[i+1] = f.gcd(leftGCD[i],A[i])
    rightGCD[-i-2] = f.gcd(rightGCD[-i-1],A[-i-1])

#print(leftGCD)
#print(rightGCD)

ans = 0

for i in range(N):
    ans = max(ans,f.gcd(rightGCD[i],leftGCD[i]))

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)
    

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)

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

if a==b : 
    print(a*2)
else :
    print(max(a,b)*2-1)
    

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)
    

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

if a==b : 
  print(a*2)
else :
  print(max(a,b)*2-1)
Buggy python submission (verdict: Runtime Error):
import math

i = [int(x) for x in input().split()]

ans = math.ceil((i[0]/ (i[2] + i[1])) ) * i[1]

print (ans)

Fixed submission:
d = list(input())

s = {i for i in d}

if len(s) == 1:
  print ("No")
else :
  print ("Yes")

Buggy python submission (verdict: Runtime Error):
s = list(input())

d = { x for x in s}

if len(d) == 1:
  print ("NO")
else :
  print ('YES')
  
  

Fixed submission:
d = list(input())

s = {i for i in d}

if len(s) == 1:
  print ("No")
else :
  print ("Yes")
Buggy python submission (verdict: Runtime Error):
    N,A,B = map(int,input().split())
    #Aが青
    #Bが赤
    i = N // (A+B)
    b = i*A
    t = N % (A+B)

    if t > A:
        t = A

    print(b+t)

Fixed submission:
N,A,B = map(int,input().split())
#Aが青
#Bが赤
i = N // (A+B)
b = i*A
t = N % (A+B)
if t > A:
   t = A
print(b+t)
Buggy python submission (verdict: Runtime Error):
M=[]
for _i in range(3):
  M.append(list(map(int,input().split())))
n= int(input())
for a in range(n):
  b= int(input())
  for i in range(3):
    for j in range(3):
      if M[i][j]==b:
        M[i][j]=-1
oassiy= False
for i in range(3):
  cont=0
  for j in range(3):
    if M[i][j]==-1:
      cont+=1
  if cont==3:
    break
    oassiy=True

if not oassiy:
 for j in range(3):
  cont=0
  for i in range(3):
    if M[i][j]==-1:
      cont+=1
  if cont==3:
    break
    oassiy=True

if not oassiy:
  cont1 = cont2= 0
  for i in range(3):
    if M[i][i]==-1:
      cont1+=1
    if M[i][2-i]==-1:
      cont2+=1
if (cont1==3) or (cont2==3):
    oassiy=True

print('Yes' if oassiy else 'No')


Fixed submission:
n= int(input())
if n%2==0:
  print(n//2)
else:
  print(n//2+1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
H= list(map(int,input().split()))
if(k<n):
  H.sort()
  for i in range(k):
    H.pop()
  cont=0
  for i in range(len(H)):
    while H[i]>0:
      H[i]-=1
      cont+=1
  print(cont)
else:
  print(0)


Fixed submission:
n,k = map(int,input().split())
H= list(map(int,input().split()))
if(k<n):
  H.sort()
  for i in range(k):
    H.pop()
  cont=0
  for i in range(len(H)):
    cont+= H[i]
  print(cont)
else:
  print(0)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
H= list(map(int,input().split()))
H.sort()
for i in range(k):
  H.pop()
cont=0
for i in range(len(H)):
  while H[i]>0:
    H[i]-=1
    cont+=1
print(cont)


Fixed submission:
n,k = map(int,input().split())
H= list(map(int,input().split()))
if(k<n):
  H.sort()
  for i in range(k):
    H.pop()
  cont=0
  for i in range(len(H)):
    cont+= H[i]
  print(cont)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
V=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','y','z']
ch = input()
for i in range(26):
  if(ch==V[i]):
    print(V[i+1])


Fixed submission:
V=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','y','z']
ch = input()
for i in range(25):
  if(ch==V[i]):
    print(V[i+1])
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input)
print(-((-b+1)//(a-1)))

Fixed submission:
a,b=map(int, input().split())
print(-((-b+1)//(a-1)))
Buggy python submission (verdict: Time Limit Exceeded):
n,y = map(int,input().split())
for a in range(n+1):
  for b in range(n+1):
    for c in range(n+1):
      if 10000*a + 5000*b + 1000*c == y and a+b+c == n:
        print(a,b,c)
        exit()
print("-1 -1 -1")

Fixed submission:
n,y = map(int,input().split())
for a in range(n+1):
  for b in range(n+1):
    c = n-a-b
    if 10000*a + 5000*b + 1000*c == y and a+b+c == n and c >= 0:
      print(a,b,c)
      exit()
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
A, B, C = sorted(map(int, input().split()))
print(10*c +a +b)

Fixed submission:
A, B, C = sorted(map(int, input().split()))
print(10*C+B+A)
Buggy python submission (verdict: Runtime Error):
N,R=map(int, input().split()) 

if N => 10
print(R)
else
print(R - 100*(10-N))

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

if N >= 10:
  print(R)
else:
  print(R + 100*(10-N))
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split())

num = 1

if N<K:
  print(num)
else:
  N // K = N
  num = num + 1

  


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

num = 1

while N >= K:
  N = N//K 
  num = num + 1
  
print(num)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X=list(map(int, input().split())) 
print(X)
X_max = max(X)
X_min = min(X)

answerlist = []
for i in range(X_min,X_max):
  newX = [(n-i)**2 for n in X]
  print(newX)
  total = sum(newX)
  answerlist.append(total)
  
print(min(answerlist))

Fixed submission:
N = int(input())
X=list(map(int, input().split())) 
X_max = max(X)
X_min = min(X)
 
answerlist = []
for i in range(X_min,X_max+1):
  newX = [(n-i)**2 for n in X]
  total = sum(newX)
  answerlist.append(total)
  
print(min(answerlist))

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

X_max = max(X)
X_min = min(X)

answerlist = []
for x in range(X_min,X_max):
  newX = [(n-x)^2 for n in X]
  sum = sum(str(newX))
  answerlist.append(sum)
  
print(max(answerlist))
  
  
    
  


Fixed submission:
N = int(input())
X=list(map(int, input().split())) 
X_max = max(X)
X_min = min(X)
 
answerlist = []
for i in range(X_min,X_max+1):
  newX = [(n-i)**2 for n in X]
  total = sum(newX)
  answerlist.append(total)
  
print(min(answerlist))

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

X_max = max(X)
X_min = min(X)

answerlist = []
for x in range(X_min,X_max):
  newX = [(n-x)^2 for n in X]
  sum = sum(newX)
  answerlist.append(sum)
  
print(max(answerlist))
  
  
    
  

Fixed submission:
N = int(input())
X=list(map(int, input().split())) 
X_max = max(X)
X_min = min(X)
 
answerlist = []
for i in range(X_min,X_max+1):
  newX = [(n-i)**2 for n in X]
  total = sum(newX)
  answerlist.append(total)
  
print(min(answerlist))
Buggy python submission (verdict: Runtime Error):
N=int(input())
li = list(map(int,input().split()))

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      break
    else:
      continue
  continue
  print('APPROVED')

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

if A==B and B==C:
  print('No')
elif A != B and B != C and C != A:
  print('No')
else:
  print('Yes')

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

for i in li:
  if i%2 ==0:
    if i%3 == 0 or i%5 == 0:
      a
    else:
      print('DENIED')
      break
  print('APPROVED')

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

if A==B and B==C:
  print('No')
elif A != B and B != C and C != A:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N=int(input())
li = list(map(int,input().split()))

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag = 0:
  print('APPROVED')

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')

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

for i in li:
  if i%2 ==0:
    if i%3 == 0 or i%5 == 0:
    else:
      print('DENIED')
      break
  print('APPROVED')


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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')

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

for i in li:
  if i%2 ==0:
    if i%3 == 0 or i%5 == 0:
    else:
      print('DENIED')
      break

print('APPROVED')

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())

p = list(map(int,input().split()))

dices = p[:k]

def exp(n):
    return n*0.5 + 0.5

def exp_list(l):
    total = 0
    for n in l:
        total += exp(n)
    return total

ans = exp_list(dices)

for i in range(1,n-k+1):
    del dices[0]

    dices.append(p[i+k-1])

    tmp = exp_list(dices)

    if tmp > ans:
        ans = tmp

print(ans)

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

p = list(map(int,input().split()))

def exp(n):
    return n*0.5 + 0.5

ans = 0
for i in range(k):
    ans += p[i]
    tmp = ans

for i in range(n-k):
    tmp = tmp - p[i] + p[i+k]
    if tmp > ans:
        ans = tmp

print(ans*0.5 + k*0.5)
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reversed=True)

h = h[k:]

print(sum(h))

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

h.sort(reverse=True)

h = h[k:]

print(sum(h))
Buggy python submission (verdict: Runtime Error):
s,t = map(int, input().split())

print(t+s)

Fixed submission:
s,t = input().split()

print(t+s)
Buggy python submission (verdict: Time Limit Exceeded):
A,B = map(int, input().split())

if A > B:
  tmp = B
  B = A
  A = tmp
  
i = 1
while True:
  if (A*i) % B == 0:
    print(A*i)
    break

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

import fractions

print(int(a*b/fractions.gcd(a,b)))
Buggy python submission (verdict: Runtime Error):
def abc(n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - (n%10)

ans = 0
mods = []

for _ in range(5):
    tmp = int(input())
    ans += abc(tmp)
    if tmp%10 != 0:
        mods.append(tmp%10)

ans -= 10
ans += min(mods)
print(ans)

Fixed submission:
def abc(n):
    if n % 10 == 0:
        return n
    else:
        return n + 10 - (n%10)

ans = 0
mods = []

for _ in range(5):
    tmp = int(input())
    ans += abc(tmp)
    mods.append(tmp%10)

if not set(mods) == {0}:
    while 0 in mods:
        mods.remove(0)
    ans -= 10
    ans += min(mods)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import numpy as np

A,B = map(int, input().split())
if A != 0:
    A = A-1
ans = 0
total_10 = 0

AA = []
BB = []

for i in range(1,40):

    if int((A % 2**(i+1))/2) in [2**(i+1) - m for m in range(1,2**(i-1)+1)]:
        AA.append(1)
    else:
        AA.append(0)

    if int((B % 2**(i+1))/2) in [2**(i+1) - m for m in range(1,2**(i-1)+1)]:
        BB.append(1)
    else:
        BB.append(0)

AA = AA[::-1]
BB = BB[::-1]

if A % 4 in [1,2]:
    AA.append(1)
else:
    AA.append(0)

if B % 4 in [1,2]:
    BB.append(1)
else:
    BB.append(0)

ans_a = "".join(list(map(str,AA)))
ans_b = "".join(list(map(str,BB)))

print(ans_a)
print(ans_b)

ans_a = int(ans_a,2)
ans_b = int(ans_b,2)

print(ans_a^ans_b)

Fixed submission:
from collections import Counter
import numpy as np

A,B = map(int, input().split())
if A != 0:
    A = A-1

def ruiseki_XOR(N):
    if (N+1) % 2 == 0:
        if ((N+1)//2) % 2 == 0:
            return 0
        else:
            return 1
    else:
        if ((N+1)//2) % 2 == 0:
            return N
        else:
            return 1^N


a = ruiseki_XOR(A)
b = ruiseki_XOR(B)

print(a^b)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

S = input()
a = len(S)

for i in range(int(10**5/2)):
    S = S.replace("01","",1)
    S = S.replace("10","",1)

b = len(S)

print(a-b)

Fixed submission:
from collections import deque

S = input()

print(len(S) - abs(S.count("0") - S.count("1")))
Buggy python submission (verdict: Runtime Error):
N = int(input())

h = list(map(int,input().split()))

ans = 0
minh = min(h)
ans += min(h)

h = list(map(lambda x: x-minh, h))

while True:
    rightflag = False

    for i in range(N):
        if h[i] == 0:
            continue
        else:
            left = i
            break

    for j in range(left,N):
        if h[j] != 0:
            continue
        else:
            right = j-1
            rightflag = True
            break

    if not rightflag:
        right = N-1

    # print(left,right)

    tmp = min(h[left:right+1])
    ans += tmp

    for pos in range(left,right+1):
        h[pos] -= tmp

    # print(h)
    if set(h) == {0}:
        break

print(ans)

Fixed submission:
N = int(input())

h = list(map(int,input().split()))

ans = 0
minh = min(h)
ans += min(h)

h = list(map(lambda x: x-minh, h))

if set(h) == {0}:
    print(ans)

else:
    while True:
        rightflag = False

        for i in range(N):
            if h[i] == 0:
                continue
            else:
                left = i
                break

        for j in range(left,N):
            if h[j] != 0:
                continue
            else:
                right = j-1
                rightflag = True
                break

        if not rightflag:
            right = N-1

        # print(left,right)

        tmp = min(h[left:right+1])
        ans += tmp

        for pos in range(left,right+1):
            h[pos] -= tmp

        # print(h)
        if set(h) == {0}:
            break

    print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = map(int, input().split())

mean = sum(a)/N

a = map(lambda x: abs(x-mean), a)

print(min(a).index)

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

a = list(map(lambda x: int(abs(N*x-sum(a))), a))

print(a.index(min(a)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A = map(int, input().split())
H = [int(i) for i in input().split]

dif = float("inf")

for i in range(N):
    temp = T - H[i] * 0.006
    dif2 = abs(A-temp)
    if dif2 < dif:
        dif = dif2
        ans = i

print(ans)

Fixed submission:
N = int(input())
T,A = map(int, input().split())
H = [int(i) for i in input().split()]

dif = float("inf")

for i in range(N):
    temp = T - H[i] * 0.006
    dif2 = abs(A-temp)
    if dif2 < dif:
        dif = dif2
        ans = i

print(ans+1)