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

Fixed submission:
N = int(input())

'''
def mcd(a, b) :
    if (a, b) in memo.keys() :
        return memo[(a, b)]
    else :
        if max(a, b) % min(a, b) == 0 :
            return min(a, b)
        else :
            memo[(a, b)] = mcd(min(a, b), max(a, b) % min(a, b))
            return memo[(a, b)]

def lcm(a, b) :
    return int((a * b) / mcd(a, b))
'''

def gcd(x, y) :
    if y == 0 : return x
    else : return gcd(y, x % y)

h = 1

for i in range(N) :
    n = int(input())
    
    h = n * h // gcd(n, h)
    
print(h)

Buggy submission (verdict: Runtime Error):
N = int(input())
memo = {}

def mcd(a, b) :
    if (a, b) in memo.keys() :
        return memo[(a, b)]
    else :
        if max(a, b) % min(a, b) == 0 :
            return min(a, b)
        else :
            memo[(a, b)] = mcd(min(a, b), max(a, b) % min(a, b))
            return memo[(a, b)]

def lcm(a, b) :
    return int((a * b) / mcd(a, b))

cur_lcm = 1

for i in range(N) :
    n = int(input())
    
    cur_lcm = lcm(cur_lcm, n)
    
print(cur_lcm)

Buggy submission (verdict: Runtime Error):
N = int(input())
t = [int(input()) for x in range(N)]

def mcd(a, b) :
    if max(a, b) % min(a, b) == 0 :
        return min(a, b)
    else :
        return mcd(min(a, b), max(a, b) % min(a, b))

def lcm(a, b) :
    return int((a * b) / mcd(a, b))

t_s = sorted(t)

cur_lcm = t_s[0]
for i in range(1, len(t_s)) :
    cur_lcm = lcm(cur_lcm, t_s[i])
    
print(cur_lcm)

Buggy submission (verdict: Runtime Error):
N = int(input())
t = [int(input()) for x in range(N)]

def lcm(a, b) :
    if max(a, b) % min(a, b) == 0 :
        return max(a, b)
    else :
        return a*b / gcd(a, b)
    
def gcd(a, b) :
    if max(a, b) % min(a, b) == 0:
        return min(a, b)
    else :
        return gcd(max(a, b) % min(a, b), min(a, b))
    
cur_lcm = t[0]
for i in range(1, N) :
    cur_lcm = lcm(cur_lcm, t[i])

print(int(cur_lcm))
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
    print("T")
elif b=="C":
    print("G")
elif b=="G":
    print("C")
elif b=="T":
    print("A")

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
ls=[];rs=[]
for i in range(Q):
    l,r=map(int,input().split())
    n=0;a=False
    for k in S[(l-1):(r)]:
        if k!="A" and a==False:
            pass
        elif k=="A":
            a=True
        elif a:
            if k=="C":
                n+=1
            else:
                a=False
    print(n)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
ls=[];rs=[]
for i in range(Q):
    l,r=map(int,input().split())
    n=0;a=False
    for k in S[(l-1):(r)]:
        if k!="A" and a==False:
            pass
        elif k=="A":
            a=True
        elif a:
            if k=="C":
                n+=1
            else:
                a=False
    print(n)
Problem p03101 (python)

Fixed submission:
GR=input().split()
G2R2=input().split()
G=int(GR[0])
R=int(GR[1])
G2=int(G2R2[0])
R2=int(G2R2[1])
print(str(G*R-(G2*R+R2*G-G2*R2)))

Buggy submission (verdict: Runtime Error):
NM=input().split()
N=int(NM[0])
M=int(NM[1])#必要な本数
A=[]
B=[]
for i in range(N):
  AB=input().split()
  A.append(int(AB[0]))
  B.append(int(AB[1]))
money=0
while A!=[]:
  if M>B[A.index(min(A))]:
    money+=min(A)*B[A.index(min(A))]
    #消す
    ai=A.index(min(A))
    A.remove(min(A))
    B.remove(B[ai])
  elif M<B[A.index(min(A))]:
    money+=min(A)*M
    break
  elif M==B[A.index(min(A))]:
    money+=min(A)*M
    break
  else:
    pass
print(str(money))
Problem p03105 (python)

Fixed submission:
ABC=input().split()#2 11 4
A=int(ABC[0]);B=int(ABC[1]);C=int(ABC[2])
count=0
while A<=B:
    count+=1
    B=B-A
if count<C:
    print(str(count))
else:
    print(str(C))

Buggy submission (verdict: Runtime Error):
ABC=input().split()#2 11 4
A=int(A);B=int(B);C=int(C)
count=0
while A<=B:
    count+=1
    B=B-A
if count<C:
    print(str(count))
else:
    print(str(C))
Problem p03136 (python)

Fixed submission:
N=int(input())
Ls=input().split()#str
L=[int(i) for i in Ls]
mx=max(L);L.remove(mx)
all=0
for j in L:all+=j
if all>mx:print("Yes")
else:print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
Ls=input().split()
mx=max(Ls)
start=0
for i in Ls:
  start+=(N-int(i))
if start>mx:
  print("Yes")
else:
  print("No")
Problem p03219 (python)

Fixed submission:
number=input()
num_sp=number.split(" ")
num=int(num_sp[0])+(int(num_sp[1])/2)
print("%s"%(int(num)))

Buggy submission (verdict: Runtime Error):
number=input()
num_sp=number.split(" ")
num=num_sp[0]+(num_sp[1]/2)
print("%s"%(num))

Buggy submission (verdict: Runtime Error):
number=input()
num_sp=number.split(" ")
num=num_sp[0]+(num_sp[1]/2)
print("%s"%(num))
Problem p03238 (python)

Fixed submission:
N=int(input())
if N==1:
    print("Hello World")
elif N==2:
    A=int(input())
    B=int(input())
    print(str(A+B))

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==1:
    print("Hello World")
elif N==2:
    A=int(input())
    B=int(input())
    print(str(A+B)
Problem p03385 (python)

Fixed submission:
str=input()
list=["a","b","c"]
if str[0] in list:
  list.remove(str[0])
  if str[1] in list:
    list.remove(str[1])
    if str[2] in list:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
str=input()
list=["a","b","c"]
if str[1] in list:
  list.remove(str[1])
  if str[2] in list:
    list.remove(str[2])
    if str[3] i list:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")
Problem p03738 (python)

Fixed submission:
a=input()
b=input()
a=int(a)
b=int(b)
if a>b:
    print("GREATER")
elif a==b:
    print("EQUAL")
else:
    print("LESS")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if a>b:
    print("GREATER")
elif a=b
    print("EQUAL")
else
    print("LESS")
Problem p03455 (python)

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

if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
import sys
a = int(sys.argv[1])
b = int(sys.argv[2])

if (a * b) % 2 == 0:
	print('Even')
else:
	print('Odd')

Buggy submission (verdict: Runtime Error):
import sys
a = int(sys.argv[1])
b = int(sys.argv[2])

if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
import sys
a = int(sys.argv[1])
b = int(sys.argv[2])
if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
import sys
	a = int(sys.argv[1])
	b = int(sys.argv[2])

	if (a * b) % 2 == 0:
		print("Even")
	else:
		print("Odd2)

Buggy submission (verdict: Runtime Error):
import sys
	a = sys.argv[1]
	b = sys.argv[2]

	if (a * b) % 2 == 0:
		print("Even")
	else:
		print("Odd")
Problem p03844 (python)

Fixed submission:
x = input()
print(eval(x))

Buggy submission (verdict: Runtime Error):
print(eval(input())

Buggy submission (verdict: Runtime Error):
print(eval(input())
Problem p03943 (python)

Fixed submission:
A = list(map(int, input().split()))
x = sorted(A)
if x[0] + x[1] == x[2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
x = sorted(A)
if x[0] + x[1] == x[2]:
  print('Yes')
else:
  print('No'
Problem p04012 (python)

Fixed submission:
import collections

s = []
a = 0
x = input()
if len(x) % 2 != 0:
    print('No')
else:
    for i in x:
        s.append(i)
    c = collections.Counter(s)
    values, counts = zip(*c.most_common())
    for j in counts:
        if j % 2 == 0:
            a += 1
    if len(counts) == a:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
 import collections

s = input()
lst = []
for i in s:
    lst.append(i)
c = collections.Counter(lst)
if sum(c.values()) % 2 == 0:
    print('Yes')
else:
    print('No')
Problem p03369 (python)

Fixed submission:
s = input()

num = s.count('o')

print( 700 + num *100 )

Buggy submission (verdict: Runtime Error):
l = input().split(' ')
a,b,c,x,y = int(l[0]),int(l[1]),int(l[2]),int(l[3]),int(l[4])

place = []

place.append( a * x + b * y )

if x-y > 0:
    place.append(c * x * 2)
else:
    place.append(c * y * 2)

if x < y :
    place.append(c * x * 2 + b * (y-x))
else :
    place.append(c * y * 2 + a * (x-y))
    
print(sorted(place)[0])

Buggy submission (verdict: Runtime Error):
l = input().split(' ')
a,b,c,x,y = int(l[0]),int(l[1]),int(l[2]),int(l[3]),int(l[4])

place = []
# 全部1枚サイズ
place.append( a * x + b * y )

# 多いほうに合わせる
if x-y > 0:
    place.append(c * x * 2)
else:
    place.append(c * y * 2)

# 少ないほうに合わせてハーフ + 足りない分
if x < y :
    place.append(c * x * 2 + b * (y-x))
else :
    place.append(c * y * 2 + a * (x-y))
    
print(sorted(place)[0])
Problem p04030 (python)

Fixed submission:
import re
S = input()
if 'B' in S:
	A = re.split("01BB|10BB|11BB|00BB|0B|1B",S)
	A = "".join(A)
	if 'B' in A:
		C = re.split("01BB|10BB|11BB|00BB|0B|1B",A)
		C = "".join(C)
		C = C.split("B")
		print("".join(C))
	else:
		print(A)
else:
	print(S)

Buggy submission (verdict: Runtime Error):
S = input()
A = []
for l in S:
	if l == '0' or l == '1':
		A.append(l)
	else:
		A.pop()
print("".join(A))
Problem p03624 (python)

Fixed submission:
alphabets = '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'.split()
s = sorted(list(set(input())))
N = len(s)
i = 0
while(alphabets[i] in s):
    i += 1
    if(i == 26):
        break
if(i == 26):
    print('None')
else:
    print(chr(i+97))

Buggy submission (verdict: Runtime Error):
alphabets = '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'.split()
s = sorted(list(set(input())))
N = len(s)
i = 0
while(alphabets[i] in s):
    i += 1
print(chr(i+97))
Problem p03106 (python)

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

def gcd(a, b):
	while b:
		a, b = b, a % b
	return int(a)

GCA = gcd(A, B)
A_all_div=[]
B_all_div=[]


for i in range(1,A+1):
    if A % i == 0:
        if i <= GCA:
            A_all_div.append(i)
A_all_div.sort(reverse=True)

for i in range(1,B+1):
    if B % i == 0:
        if i <= GCA:
            B_all_div.append(i)
B_all_div.sort(reverse=True)

ALL_DIV = set(A_all_div) & set(B_all_div)
all_div = list(ALL_DIV)

all_div.sort(reverse=True)

print(all_div[K-1])

Buggy submission (verdict: Runtime Error):
import math

A,B,K = map(int,input().split(" "))
GCA = math.gcd(A, B)
all_div=[]

C = min(A,B)

for i in range(1,C+1):
    if C % i == 0:
        if i <= GCA:
            all_div.append(i)
all_div.sort(reverse=True)
print(all_div[K-1])
Problem p03125 (python)

Fixed submission:
N = input().split(" ")
A = int(N[0])
B = int(N[1])

if B % A == 0:
    ans = B + A
else:
    ans = B - A

print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
A = int(N[0])
B = int(N[2])

if B % A == 0:
    ans = B - A
else:
    ans = A + B

print(ans)
Problem p03352 (python)

Fixed submission:
# coding: utf-8
# Your code here!

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(sqrt_X):
    for p in range(sqrt_X - 1):
        now_num = (b+1)**(p+2)
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(1,sqrt_X + 1):    ##最後は含まないので＋１する必要がある
    for p in range(2,sqrt_X): 　##pは2から始めまる
        now_num = b**p
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)
Problem p03657 (python)

Fixed submission:
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=int(b[0])
B=int(b[1])

C=A+B
if C%3==0 or A%3==0 or B%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
N=int(input())
b=input()
c=b.split(" ")
d=map(int,c)
a=list(d)
sum_a=abs(sum(a))
ans=sum_a%2
if sum_a==0:
    A=map(abs,a)
    B=list(A)
    ans2=min(B)
    print(ans2*2)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=b[0]
B=b[1]

C=A+B
if C%3==0 or A%3==0 or B%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
a=input()
b=a.split(" ")
A=b[0]
B=b[1]
C=A+B
print(b)
if C%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=b[0]
B=b[1]

C=A+B
if C%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
a=[2,3]
b=a.split(",")
A=b[0]
B=b[1]

C=A+B
if C%3==0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=b[0]
B=b[1]

C=A+B
if C%3==0:
    print("Possible")
elif:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
A=b[0]
B=b[1]

C=A+B
if C%3==0:
    print("Possible")
elif:
    print("Impossible")
Problem p03658 (python)

Fixed submission:
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
N=int(b[0])
K=int(b[1])
ans=[]
c=input()
l=c.split(" ")
l1=map(int,l)
l2=list(l1)
for w in range(K):
    ans.append(max(l2))
    max_idx = l2.index(max(l2))
    del l2[max_idx]
print(sum(ans))

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
a=input()
b=a.split(" ")
N=int(b[0])
K=int(b[1])

ans=[]
l=[]
for i in range(N):
    l.append(int(input()))
for w in range(K):
    ans.append(max(l))
print(sum(ans))
Problem p03079 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a == b == c:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a==b==c:
Problem p03085 (python)

Fixed submission:
b = input()

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

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

if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'G':
  print('C')
else:
  print('G')
Problem p03125 (python)

Fixed submission:
a, b = map(int, input().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a,b = map(int(input().split()))
if b%a==0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
if b%a==0:
    print(a+b)
else:
    print(b-a)
Problem p03455 (python)

Fixed submission:
s = input().rstrip().split(' ')
a = int(s[0])
b = int(s[1])
if a*b%2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
N = int(input())
z_t = []*N
t0 = 0
x0 = 0
y0 = 0
ans = 'NO'
for i in range(N):
    s = input().rstrip().split()
    z_t.append(s)

for i in range(N):
    dt = int(z_t[i][0]) - t0
    dx = abs(int(z_t[i][1]) - x0)
    dy = abs(int(z_t[i][2]) - y0)
    extra_t = dt - (dx+dy)

    if extra_t >=  0 and extra_t%2 == 0:
        t0 = int(z_t[i][0])
        x0 = int(z_t[i][1])
        y0 = int(z_t[i][2])
        if i == N-1:
            ans = 'YES'
    else:
        break


print(ans)
Problem p03074 (python)

Fixed submission:
N, K = map(int, input().split())
S = list(map(int, input()))
 
Z = [j for j, s in enumerate(S) if (j > 0 and s == 0 and S[j] != S[j-1]) or (j == 0 and s == 0)] + [N]
Y = [j for j, s in enumerate(S) if (j > 0 and s == 1 and S[j] != S[j-1]) or (j == 0 and s == 1)]
result = 0
if len(Z) <= K:
    print(N)
else:
    for i in range(len(Z)-K):
        if i == 0:
            result = Z[i+K]
        else:
            result = max(result, Z[i+K] - Y[i if Y[0] < Z[0] else i-1])
    print(result)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(map(int, input()))
 
Z = [j for j, s in enumerate(S) if (j > 0 and s == 0 and S[j] != S[j-1]) or (j == 0 and s == 0)] + [N]
Y = [j for j, s in enumerate(S) if (j > 0 and s == 1 and S[j] != S[j-1]) or (j == 0 and s == 1)]
result = 0
if len(Z) <= K:
    print(N)
else:
    for i in range(len(Z)-K):
        if i == 0:
            result = Z[i+K]
        else:
            result = max(result, Z[i+K] - Y[i])
    print(result)
Problem p03457 (python)

Fixed submission:
n = int(input())
a = list(range(n))
for i in range(n):
    a[i] = list(map(int, input().split()))
dx = 0
dy = 0
c = 0
k = 0
for s in range(n):
    dx = a[s][1] - dx
    dy = a[s][2] - dy
    if((dx+dy)>a[s][0]):
        print("No")
        break
    if(((abs(dx)+abs(dy))%2) == ((a[s][0]-k)%2)):
        c += 1
        k += a[s][0]
    else:
        print("No")
        break
if(c == n):
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(range(n))
for i in range(n):
    a[i] = list(map(int, input().split()))
tmpx = 0
tmpy = 0
for s in range(n):
    tmpx = a[s][1] - tmpx
    tmpy = a[s][2] - tmpy
    if((dx+dy)>a[s][0]):
        print("NO")
        break
    if(((dx+dy)%2) == (a[s][0]%2)):
        print("YES")
        break
    else:
        print("NO")
        break
Problem p03543 (python)

Fixed submission:
import sys
M=input()
 
for i in range(10):
  if(M.find(str(i)*3)!=-1):
    print("Yes")
    sys.exit()
print("No")

Buggy submission (verdict: Runtime Error):
import sys
M=input()

for i in range(l0):
  if(M.find(str(i))!=-1):
    print("Yes")
    sys.exit()
print("No")
Problem p03078 (python)

Fixed submission:
X, Y, Z, K = map(int,input().split())
A_list = sorted(list(map(int,input().split())), reverse=True)
B_list = sorted(list(map(int,input().split())), reverse=True)
C_list = sorted(list(map(int,input().split())), reverse=True)

E_list = sorted([ai+bi for ai in A_list for bi in B_list], reverse=True)[:K]
sum_list = sorted([ei+ci for ei in E_list for ci in C_list], reverse=True)[:K]

for i in range(K):
    print(sum_list[i])

Buggy submission (verdict: Runtime Error):
X, Y, Z, K = map(int,input().split())
A_list = sorted(list(map(int,input().split())), reverse=True)
B_list = sorted(list(map(int,input().split())), reverse=True)
C_list = sorted(list(map(int,input().split())), reverse=True)

E_list = sorted([ai+bi for ai in A_list for bi in B_list], reverse=True)[:K]
sum_list = sorted([ei+ci for ci in E_list for ci in C_list], reverse=True)[:K]

for i in range(K):
    print(sum_list[i])
Problem p03105 (python)

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


print(min(c, b//a))

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


print(max(c, b//a))
Problem p03145 (python)

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

print(a*b//2)

Buggy submission (verdict: Runtime Error):
from itertools import groupby
from heapq import heapify, heappop

N, K = map(int, input().split())
sushi = [tuple(map(int, input().split())) for _ in range(N)]

srt = sorted(sushi, key=lambda x: x[1], reverse=True)
eat, non_eat = srt[:K], srt[K:]

maxs = []
rems = []
kinds = set()
for k, g in groupby(sorted(eat, key=lambda x: x[0]), key=lambda x: x[0]):
    d = list(list(zip(*g))[1])
    maxs.append(d.pop(0))
    rems.extend(d)
    kinds.add(k)
heapify(rems)
ans = sum(maxs) + sum(rems) + len(kinds)**2

for k, g in groupby(sorted(non_eat, key=lambda x: x[0]), key=lambda x: x[0]):
    if k in kinds:
        continue
    if not rems:
        break
    d = list(list(zip(*g))[1])
    maxs.append(d.pop(0))
    heappop(rems)
    kinds.add(k)
    ans = max(ans, sum(maxs) + sum(rems) + len(kinds)**2)

print(ans)
Problem p03244 (python)

Fixed submission:
from collections import defaultdict

n = int(input())
v = list(map(int, input().split()))

odd = defaultdict(lambda: 0)
even = defaultdict(lambda: 0)
odd[None] = 0
even[None] = 0
for i in v[0::2]:
    odd[i] += 1
for i in v[1::2]:
    even[i] += 1

odd = sorted(odd.items(), key=lambda x: x[1], reverse=True)
even = sorted(even.items(), key=lambda x: x[1], reverse=True)
if odd[0][0] != even[0][0]:
    count = n - odd[0][1] - even[0][1]
else:
    count = n - max(odd[0][1]+even[1][1], odd[1][1]+even[0][1])

print(count)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

n = int(input())
v = list(map(int, input().split()))

if len(set(v)) == 1:
    count = n//2
else:
    odd = defaultdict(lambda: 0)
    even = defaultdict(lambda: 0)
    for i in v[0::2]:
        odd[i] += 1
    for i in v[1::2]:
        even[i] += 1
    o1, o2, *_ = sorted(odd.items(), key=lambda x: x[1], reverse=True)
    e1, e2, *_ = sorted(even.items(), key=lambda x: x[1], reverse=True)
    if o1[0] != e1[0]:
        count = n - o1[1] - e1[1]
    elif o1[1] >= e1[1]:
        count = n - o1[1] - e2[1]
    elif o1[1] < e1[1]:
        count = n - o2[1] - e1[1]

print(count)
Problem p03359 (python)

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

if a<= b:
    print(a)
else:
    print(a-1)

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

if a <= b:
    return a
else:
    return b
Problem p03377 (python)

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

if a <= x <= a+b:
    print('YES')
else:
    print('NO')

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

a.sort()

old = 0
for item in a[:-1]:
    if abs(old - a[-1]/2) <= abs(item - a[-1]/2):
        print(a[-1], old)
        break
    old = item
Problem p03380 (python)

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

a.sort()

min = a[-1]/2
r = a[0]
for item in a[:-1]:
    if abs(item - a[-1]/2) < min:
        min = abs(item - a[-1]/2)
        r = item
print(a[-1], r)

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

a.sort()

old = 0
for item in a[-1]:
    if abs(old - a[-1]/2) <= abs(item - a[-1]/2):
        print(a[-1], old)
        break
    old = item
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
listAB=[]
for i in range(min(A,B)):
    if A%(i+1)==0 and B%(i+1)==0:
        listAB.append(i+1)
listAB.sort(reverse=1)
if A==1 and B==1:
    print(1)
else :
    print(listAB[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K=int(input().split())
listAB=[]
for i in range(min(A,B)):
    if A%(i+1)==0 and B%(i+1)==0:
        listAB.append(i+1)
listAB.sort(reverse=1)
if A==1 and B==1:
    print(1)
else :
    print(listAB[K-1])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
 for i in range(1,A):
     if(A%i==0 and B%i==0):
         div.append(i)
div.sort()
print(div[len(div)-K])
Problem p03110 (python)

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

for i in range(n):
    gt=input().split()
    if gt[1]=="BTC":
        money+=float(gt[0])*380000
    else:
        money+=float(gt[0])

print(money)

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

for i in range(n):
    gt=input().split()
    if gt[1]=="BTC":
        money+=float(g[0])*380000
    else:
        money+=float(g[0])

print(money)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=0
for i in range(N):
    x=int(input())
    u=input()
    if(u=="JPY"):
        ans+=x
    else :
        ans+=int(x*380000)
print(ans)
Problem p03251 (python)

Fixed submission:
# coding: utf-8 -*-

N, M, X, Y = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))

# print(X, a)

x_max = max(a)
y_min = min(b)


# print(x_max, y_min)

count = 'War'


for i in range(X, Y + 1):
    if i > x_max and i <= y_min and i > X and i < Y:
        count = 'No War'

print(count)

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

a=list(map(int,input().split()))
b=list(map(int,input().split()))

x_max=max(a)
y_max=max(b)

coun="War"

for i in range(X,Y+1):
    if i>x_max and i<=y_min and i>X and i<Y:
        count="No War"

print(count)