Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [init_point]*participant

for i in range(correct):
  answer_person = int(input())
  tmp[answer_person-1] += 1
  tmp = [i-1 for i in tmp]
  
for item in tmp:
  if item>0: print("Yes")
  else: print("No")

Fixed submission:
import sys

num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [0]*participant

for i in range(correct):
  answer_person = int(input())-1
  tmp[answer_person] += 1

for i in tmp:
  if i<=correct-init_point:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [init_point]*participant

for i in range(participant):
  answer_person = int(input())
  tmp[answer_person-1] += 1
  tmp = [i-1 for i in tmp]
  
for item in tmp:
  if item>0: print("Yes")
  else: print("No")

Fixed submission:
import sys

num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [0]*participant

for i in range(correct):
  answer_person = int(input())-1
  tmp[answer_person] += 1

for i in tmp:
  if i<=correct-init_point:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [init_point]*participant

for i in range(participant):
  answer_person = int(input())
  tmp[answer_person-1] += 1
  tmp -= 1
  
for item in tmp:
  if item>0: print("Yes")
  else: print("No")

Fixed submission:
import sys

num = input().split()
participant = int(num[0])
init_point = int(num[1])
correct = int(num[2])

tmp = [0]*participant

for i in range(correct):
  answer_person = int(input())-1
  tmp[answer_person] += 1

for i in tmp:
  if i<=correct-init_point:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
num = int(input())
order = input().split()
manzoku = input().split()
additional = input().split()

prev = 0
ans = 0
for i in range(num):
  ans += manzoku[i]
  if i = prev+1:
    ans += additional[i]
  prev += 1
  
print(ans)

Fixed submission:
num = int(input())
order = input().split()
order = [int(i) for i in order]
manzoku = input().split()
additional = input().split()

prev = -1
ans = 0
for i in order:
  ans += int(manzoku[i-1])
  if i == prev+1:
    ans += int(additional[i-2])
  prev = i
  
print(ans)
Buggy python submission (verdict: Runtime Error):
num = input().split()

if int(num[0]) >= 3200:
  print(num[1])
else:
  print("red")

Fixed submission:
num = int(input())
col = input()

if num >= 3200:
  print(col)
else:
  print("red")

Buggy python submission (verdict: Runtime Error):
num = input().split()

print(num[1]) if int(num[0]) >= 3200 else print("red")

Fixed submission:
num = int(input())
col = input()

if num >= 3200:
  print(col)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
num = input().split()
a, b = int(num[0]), int(num[1])
tmp = []
for i in range(b-a+1,b+a):
  tmp.append(i)
print(' '.join(tmp))

Fixed submission:
num = input().split()
a, b = int(num[0]), int(num[1])
tmp = []
for i in range(b-a+1,b+a):
  tmp.append(str(i))
print(' '.join(tmp))
Buggy python submission (verdict: Runtime Error):
num = int(input())
tmp = {}
for i in range(num):
  if i in tmp: tmp[i]=1
  else: tmp[i]+=1
for k, v in tmp.items():
  if v > 1: print(k)

Fixed submission:
import math

num = int(input())
tmp = {}
flg = 0
ans = 0
for i in range(num):
  inp = ''.join(sorted(input()))
  if inp not in tmp: tmp[inp]=1
  else: tmp[inp]+=1
for k, v in tmp.items():
  if v > 1:
    ans += v*(v-1)//2
    flg = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
num = input()
ans = [9,0,900,0,90000]
tmp = 0
if len(num)%2==0:
  tmp = sum(ans[:len(num)])
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num[1:])+1

print(tmp)

Fixed submission:
num = input()
ans = [9,0,900,0,90000]
tmp = 0

if len(num)%2==0:
  tmp = sum(ans[:len(num)])
elif len(num)==1:
  tmp = num
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num)-10**(len(num)-1)+1

print(tmp)
Buggy python submission (verdict: Runtime Error):
iter_num = int(input())
num = input().split()

num_bin = [format(int(i),'b') for i in num]
max_len = len(num_bin[-1])

num_bin = [format(i, '0>{}'.format(max_len)) for i in num_bin]

tmp = []
for i in range(len(num_bin[0])):
  tmp_num = 0
  for j in num_bin:
    tmp_num += int(j[i])
  if tmp_num%2==0: tmp_num=0
  tmp.append(tmp_num)

flg = 0
for i in tmp:
  if i==0: pass
  else:
    flg = 1
    print('No')
    break
if flg == 0: print('Yes')
  

Fixed submission:
iter_num = int(input())
num = input().split()
num = sorted([int(i) for i in num])

num_bin = [format(int(i),'b') for i in num]
max_len = len(num_bin[-1])

num_bin = [format(i, '0>{}'.format(max_len)) for i in num_bin]

tmp = []
for i in range(len(num_bin[0])):
  tmp_num = 0
  for j in num_bin:
    tmp_num += int(j[i])
  if tmp_num%2==0: tmp_num=0
  tmp.append(tmp_num)

flg = 0
for i in tmp:
  if i==0: pass
  else:
    flg = 1
    print('No')
    break
if flg == 0: print('Yes')
Buggy python submission (verdict: Runtime Error):
order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0

if forw<=12 and forw != 0:
  flg_m = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_m + flg_b == 2:
  print('AMBIGUOUS')
elif flg_m == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')

Fixed submission:
order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0
 
if forw<=12 and forw != 0:
  flg_f = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_f + flg_b == 2:
  print('AMBIGUOUS')
elif flg_f == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')
Buggy python submission (verdict: Runtime Error):
num = map(int, input().split())

if num[0]%2==0 and num[1]%2==0: print('No')
else: print('Yes')

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

if num[0]%2==0 or num[1]%2==0: print('No')
else: print('Yes')
Buggy python submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[-1])

Fixed submission:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b])

print(ans[-1])

Buggy python submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = [a+b, a-b, a*b , a//b]

print(ans[-1])

Fixed submission:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b])

print(ans[-1])

Buggy python submission (verdict: Runtime Error):
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b , a//b])

print(ans[0])

Fixed submission:
num = input().split()
a, b =int(num[0]), int(num[1])

ans = sorted([a+b, a-b, a*b])

print(ans[-1])
Buggy python submission (verdict: Runtime Error):
num = input().split()
a, b, c, d = int(num[0]), nt(num[1]), nt(num[2]), nt(num[3])

if abs(a-b)<=d and abs(b-c)<=d:
  print("Yes")
else:
  print("No")

Fixed submission:
num = input().split()
a, b, c, d = int(num[0]), int(num[1]), int(num[2]), int(num[3])

if abs(a-b)<=d and abs(b-c)<=d or abs(a-c) <= d:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
import math
num = input().split()
a, b, c, d = int(num[0]), nt(num[1]), nt(num[2]), nt(num[3])

if math.abs(a-b)<=d and math.abs(b-c)<=d:
  print("Yes")
else:
  print("No")

Fixed submission:
num = input().split()
a, b, c, d = int(num[0]), int(num[1]), int(num[2]), int(num[3])

if abs(a-b)<=d and abs(b-c)<=d or abs(a-c) <= d:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
tmp = []
for i in range(4):
  tmp.append(int(input()))
  
ptint(min(tmp[0], tmp[1])+min(tmp[2], tmp[3]))

Fixed submission:
tmp = []
for i in range(4):
  tmp.append(int(input()))
  
print(min(tmp[0], tmp[1])+min(tmp[2], tmp[3]))
Buggy python submission (verdict: Runtime Error):
num = input().split(" ")
[i = int(i) for i in num]

if num[0]%num[1]==0:
  print("-1")
else:
  print(num[0])

Fixed submission:
num = input().split(" ")
num = [int(i) for i in num]
if num[0]%num[1]==0: print("-1")
else: print(num[0])

Buggy python submission (verdict: Runtime Error):
num = int(input()).split(" ")
ans=0
for i in range(10**18):
  if i%num[0]==0 and i%num[1]!=0:
    ans=i
    break
  else:
    pass
if ans==0: print(-1)
else: print(ans)

Fixed submission:
num = input().split(" ")
num = [int(i) for i in num]
if num[0]%num[1]==0: print("-1")
else: print(num[0])
Buggy python submission (verdict: Runtime Error):
print("2018"+input([4:]))

Fixed submission:
print("2018"+input()[4:])
Buggy python submission (verdict: Runtime Error):
num = input()

tmp = 0
for i in range(len(num)):
  if num[i]==num[i+1]: tmp+=1
  else: tmp=0
if tmp>=3: print('Yes')
else: print('No')

Fixed submission:
num = input()
if num[:3].count(num[0])==3 or num[1:].count(num[1])==3:
  print("Yes")
else: print("No")
Buggy python submission (verdict: Runtime Error):
num = input().split()

a,b = int(num[0]), int(num[1])
if num[1]=='+': print(a+b)
else: print(a-b)

Fixed submission:
num = input().split()

a,b = int(num[0]), int(num[2])
if num[1]=='+': print(a+b)
else: print(a-b)
Buggy python submission (verdict: Runtime Error):
word = input().split()
print(word[0][1]+word[1][1]+word[2][1])

Fixed submission:
word = input().split()
print(word[0][0]+word[1][0]+word[2][0])
Buggy python submission (verdict: Runtime Error):
num = [input() for i in range(3)]

print((num[0]+num[1])*num[2]/2)

Fixed submission:
num = [int(input()) for i in range(3)]
 
print(int((num[0]+num[1])*num[2]/2))
Buggy python submission (verdict: Runtime Error):
a = [input() for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)

Fixed submission:
a = [int(input()) for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<=a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)

Buggy python submission (verdict: Runtime Error):
n = input()
ini = input()
ini_pri=input()
left_pri=input()

ans = 0
for i in range(n):
  	if i < ini:
      ans += ini_pri
    else:
      ans += left_pri

print(ans)

Fixed submission:
a = [int(input()) for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<=a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
cnt=0
for b in range(1,n):
    for c in range(1,n):
        if (n-c)%b==0:
            cnt+=1
            # print(b,c)
        elif (n-c)/b<1:
            break
print(cnt)

Fixed submission:
n=int(input())
cnt=0

for b in range(1,n):
    cnt+=int((n-1)/b)

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
X,K,D = map(int,input().split())
dp = [[0]*2 for i in range(K+1)]
dp[0][0] = X
dp[0][1] = X

for i in range(1,K+1):
    dp[i][0] = min(abs(dp[i-1][0] - D),abs(dp[i-1][1] - D))
    dp[i][1] = min(abs(dp[i-1][0] + D),abs(dp[i-1][1] + D))
    
print(min(dp[-1]))

Fixed submission:
X,K,D = map(int,input().split())
X =abs(X)
if X == 0:
    if K % 2 == 0:
        ans = 0
    else:
        ans = D
else:
    cnt = X//D
    if cnt >= K:
        ans = X - (D*K)
    else:
        K -= cnt
        if K % 2 == 0:
            ans = X - (D*cnt)
        else:
            ans = D -(X - (D*cnt))
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K = map(int,input().split())
Current_Sum = 0
for i in range(K):
    if A > 0:
        A -= 1
        Current_Sum += 1
    elif B > 0:
        B -= 1
    else:
        Current_Sum -= 1


print(Current_Sum)




Fixed submission:
A,B,C,K = map(int,input().split())
Current_Sum = 0
if K <= A :
    ans = K
elif K <= (A + B):
    ans = A
else:
    K -= (A + B)
    ans = A - K

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
div,mod = divmod(N,5000)
div2 = (mod,5)
print(5000*div + 5*div2) 

Fixed submission:
N = int(input())
div,mod = divmod(N,500)
div2 = mod//5
print(1000*div + 5*div2)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
Poll_Dict = defaultdict(int)

N = int(input())

for i in range(N):
    Poll_Dict[str(input())] += 1
Max_List = sorted([k[0] for k in Poll_Dict.items() if k[1] == max(Poll_Dict.values())])

for i in Max_List:
    print(i)

Fixed submission:
from collections import defaultdict
Poll_Dict = defaultdict(int)

N = int(input())

for _ in range(N):
    Poll_Dict[str(input())] += 1

Max_Number = max(Poll_Dict.values())    
Max_List = sorted([k[0] for k in Poll_Dict.items() if k[1] == Max_Number])

for i in Max_List:
    print(i)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List:
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
            
            

Fixed submission:
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List.items():
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
Buggy python submission (verdict: Time Limit Exceeded):
T,A,K = map(int,input().split())
for i in range(K):
    if T > 0:
        T -= 1
    elif A > 0:
        A -= 1
print(str(T) + " " + str(A))   

Fixed submission:
T,A,K = map(int,input().split())
sta = T + A - K
if sta <= 0:
    print("0 0")
elif sta >= A:
    print(str(T-K) +" "+str(A))
else:
    print("0 " + str(sta))
Buggy python submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc148/tasks/abc148_b
N = int(input())
a,b = map(int,input().split())
moji = ""
for i in range(N):
    moji += a[i]+b[i]

print(moji)

Fixed submission:
#https://atcoder.jp/contests/abc148/tasks/abc148_b
N = int(input())
a,b = map(str,input().split())
moji = ""
for i in range(N):
    moji += a[i]+b[i]

print(moji)
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc144/tasks/abc144_c C - Walk on Multiplication Table
N=int(input())
S_List = [i for i in range(1,int(N/2)+1) if N % i ==0]
S_List.append(N)
R_S_List = S_List[::-1]

Answer=(10**6)*2
for i in range(len(S_List)):
    Current_Answer = S_List[i] + R_S_List[i] - 2
    if Current_Answer < Answer:
        Answer = Current_Answer

print(Answer)


Fixed submission:
# https://atcoder.jp/contests/abc144/tasks/abc144_c C - Walk on Multiplication Table
N=int(input())
S_List=[i for i in range(1,int(N**0.5)+1,1) if N % i ==0]

Answer = 10**12
for i in range(len(S_List)):
    Current_Answer = int(S_List[i] + (N/S_List[i]) -2)
    if Current_Answer < Answer:
        Answer = Current_Answer

print(Answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
N_List =list(map(int,input().split()))
Sort_List = []
for i in range(N):
    Sort_List.append(N_List.index(i+1)+1)

print(" ".join(list(map(str,Sort_List))))

Fixed submission:
N = int(input())
N_List =list(map(int,input().split()))
ans = [0] * N
for i in range(N):
    s = N_List[i]   
    ans[s-1] = i+1  
print(*ans)
Buggy python submission (verdict: Runtime Error):
N,K,Q = map(int,input().split())
Answer_List = {}
for i in range(Q):
    CA = int(input())
    if CA in Answer_List:
        Answer_List[CA] += 1 
    else:
        Answer_List[CA] = 1
 
Lose_Status = K - Q
if Lose_Status > 0:
    for j in range(N):
        print("Yes")
else:
    Standard = abs(Lose_Status) + 1
    for j in range(N):
        if j + 1 in Answer_List:
            if Answer_List[j + 1] >= Standard:
                print("Yes")
            else:
                print("No")
        else:
                print("No")
            

Fixed submission:
Weather_List = ["Sunny", "Cloudy", "Rainy","Sunny"]

print(Weather_List[Weather_List.index(str(input()))+1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
N_List = list(map(int,input().split()))
maxct = 0
for i in range(N-1):
    if N_List[i] >= N_List[i+1]:
        ct += 1
        if (i == N - 2) & (ct > maxct):
            maxct  = ct
    else:
        if maxct < ct:
            maxct = ct
            ct = 0

print(maxct)


Fixed submission:
N = int(input())
N_List = list(map(int,input().split()))
ans = 0
cans = 0
for i in range(1,N):
    if N_List[i] <= N_List[i-1]:
        cans += 1
    if cans > ans:
        ans = cans
    if N_List[i] > N_List[i-1]:
        cans = 0
    
print(ans)
Buggy python submission (verdict: Runtime Error):
#Guide Book https://atcoder.jp/contests/abc128/tasks/abc128_b
N = int(input())
Shop_List=[]
for i in range(N):
    Temp_List=list(input().split())
    Temp_List[1]=int(Temp_List[1])
    Temp_List.append(i+1)
    Shop_List.append(Temp_List)


Shop_List_Sorted = sorted(Shop_List, key=lambda x:(x[0], -x[1]))
for k in range(N):
    print(Shop_List_Sorted[k][2])


Fixed submission:
## from collections import Counter
from collections import Counter

N=int(input())
Word_List=[]

for i in range(N):
    Temp_Word=''.join(sorted(input()))
    Word_List.append(Temp_Word)

Word_Count=Counter(Word_List)
Word_PairCount_List = []

for i in Word_Count.values():
    if i > 1 :
        Word_PairCount_List.extend(range(i))

print(sum(Word_PairCount_List))
Buggy python submission (verdict: Runtime Error):
import itertools

L,R = map(int,input().split())
N_List = list(range(L,R+1))
N = len(N_List)
if N >= 2019:
    ans = 0
else:
    F = N_List[0] % 2019
    L = N_List[-1] % 2019
    if F < L:
        ans = 2019
        Amari_List = list(range(F,L+1))
        for v1,v2 in itertools.combinations(Amari_List, 2):
            ca = v1*v2 % 2019 
            if  ca < ans:
                ans = ca
    else:
        ans = 0

print(ans)





Fixed submission:
import itertools

L,R = map(int,input().split())
if R - L + 1 >= 2019:
    ans = 0
else:
    LL = L % 2019
    RR = R % 2019
    if LL < RR:
        Amari_List = list(range(LL,RR+1))
        ans = 2019
        for v1,v2 in itertools.combinations(Amari_List, 2):
            ca = (v1*v2) % 2019 
            if  ca < ans:
                ans = ca
    else:
        ans = 0

print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools

L,R = map(int,input().split())
N_List = list(range(L,R+1))
N = len(N_List)
if N >= 2019:
    ans = 0
else:
    F = N_List[0] % 2019
    L = N_List[-1] % 2019
    if F < L:
        ans = 2019
        Amari_List = list(range(F,L+1))
        for v1,v2 in itertools.combinations(Amari_List, 2):
            if v1*v2 < ans:
                ans = v1*v2
    else:
        ans = 0

print(ans)





Fixed submission:
import itertools

L,R = map(int,input().split())
if R - L + 1 >= 2019:
    ans = 0
else:
    LL = L % 2019
    RR = R % 2019
    if LL < RR:
        Amari_List = list(range(LL,RR+1))
        ans = 2019
        for v1,v2 in itertools.combinations(Amari_List, 2):
            ca = (v1*v2) % 2019 
            if  ca < ans:
                ans = ca
    else:
        ans = 0

print(ans)
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
flg = 0
if W/2 == x and H/2 ==y:
    ans = (W*H)/2
    flg = 1
elif W/2 == x or H/2 ==y:
    ans = (W*H)/2
    flg = 0
else:
    tatemax = min(W-x,x)*H
    yokomax = min(H-y,y)*W
    if tatemax == yokomax:
        ans = tatemax
        flg =1
    else:
        ans = max(tatemax,yokomax)
        flg =0
print(str(ans)+ " " + str(flg))

Fixed submission:
N,M = map(int,input().split())
print(("0","10")[N >= M])
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
N_List = list(range(1,N+1))
for i in range(M):
    st,sp = map(int,input().split())
    N_List = set(list(range(st,sp + 1))) & set(N_List)
print(len(N_List))

Fixed submission:
N,M = map(int,input().split())
for i in range(M):
    st,sp = map(int,input().split())
    if i == 0:
        N_List = [st,sp]
    else:
        if st > N_List[0]:
            N_List[0] = st
        if sp < N_List[1]:
            N_List[1] = sp   
print(len(list(range(N_List[0],N_List[1]+1))))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
moji = str(input())
guall = len(moji)//2
kiall = guall + len(moji) % 2
gucount=dict(Counter(moji[1::2]))
kicount=dict(Counter(moji[0::2]))
if max(gucount, key=gucount.get) != max(kicount, key=kicount.get):
    ans = guall - max(gucount.values()) + kiall - max(kicount.values())
else:
    if kiall - max(kicount.values()) > guall - max(gucount.values()):
        ans = max(kicount.values()) + guall - max(gucount.values())
    else:
        ans = max(gucount.values()) + kiall - max(kicount.values())
print(ans)

Fixed submission:
from collections import Counter
moji = str(input())
guall = len(moji)//2
kiall = guall + len(moji) % 2
gucount=dict(Counter(moji[1::2]))
kicount=dict(Counter(moji[0::2]))
if len(moji) == 1:
    ans = 0
elif max(gucount, key=gucount.get) != max(kicount, key=kicount.get):
    ans = guall - max(gucount.values()) + kiall - max(kicount.values())
else:
    if kiall - max(kicount.values()) > guall - max(gucount.values()):
        ans = max(kicount.values()) + guall - max(gucount.values())
    else:
        ans = max(gucount.values()) + kiall - max(kicount.values())
print(ans)
Buggy python submission (verdict: Runtime Error):
A = [-1] * (10 ** 9)
print(A)

Fixed submission:
##https://atcoder.jp/contests/dp/tasks/dp_a 
N = int(input())
Place_Height_List = list(map(int,input().split()))  
Min_List = [0,abs(Place_Height_List[1]-Place_Height_List[0])]

for i in range(2,len(Place_Height_List)):
    One_Step = abs(Place_Height_List[i] - Place_Height_List[i - 1]) 
    Two_Step = abs(Place_Height_List[i] - Place_Height_List[i - 2])
    Min_List.append(min(Min_List[i - 1] + One_Step,Min_List[i - 2] + Two_Step))
    
print(Min_List[-1])
Buggy python submission (verdict: Time Limit Exceeded):
##https://atcoder.jp/contests/dp/tasks/dp_b
N,K = map(int,input().split())
Place_Height_List = list(map(int,input().split()))  
Min_List = [0,abs(Place_Height_List[1]-Place_Height_List[0])]

for i in range(2,len(Place_Height_List)):
    Current_Step_Min = 10 ** 9
    for j in range(1,min(i,K)+1):
        Current_Step = Min_List[i - j] + abs(Place_Height_List[i] - Place_Height_List[i - j])
        if Current_Step_Min > Current_Step:
            Current_Step_Min = Current_Step
        
    Min_List.append(Current_Step_Min)
print(Min_List[-1])

Fixed submission:
##https://atcoder.jp/contests/dp/tasks/dp_a 
N,K = map(int,input().split())
Place_Height_List = list(map(int,input().split()))  
Min_List = [0,abs(Place_Height_List[1]-Place_Height_List[0])]

for i in range(2,len(Place_Height_List)):
    Current_Step_Min = 10 ** 9
    for j in range(1,min(i,K)+1):
        Current_Step = Min_List[i - j] + abs(Place_Height_List[i] - Place_Height_List[i - j])
        if Current_Step_Min > Current_Step:
            Current_Step_Min = Current_Step
        
    Min_List.append(Current_Step_Min)
print(Min_List[-1])