Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))

l.sort()
print(l[n/2]-l[n/2-1])

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int,input().split()))
 
L.sort()
 
target_num = int(N/2)
if L[target_num-1] = L[target_num]:
	ans = 0
else:
  	ans= L[target_num]-L[target_num-1]

print(ans)


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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = int(N/2)
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)


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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)


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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1]-1)


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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1])

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])

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

L_sorted= L.sort()

target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]
	print(0)
else:
  	print(L_sorted[target_num]-L_sorted[target_num-1])

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])
Buggy python submission (verdict: Time Limit Exceeded):
from operator import itemgetter
n=int(input())
d=[]
judge=True
bag=[]
for i in range(n):
    a,b=map(int,input().split())
    d.append([a,b])
d.sort(key=itemgetter(1))
        
for j in range(len(d)):
    bag.append(d[j][0])
    if sum(bag)>d[j][1]:
        judge=False
else:
    if judge==True:
        print("Yes")
    else:
        print("No")

Fixed submission:
n=int(input())
bag=[]
ans="Yes"
total=0
for i in range(n):
    a,b=map(int,input().split())
    bag.append([a,b])
d=sorted(bag, key=lambda x:x[1])

for j in range(n):
    total=total+d[j][0]
    if total>d[j][1]:
        ans="No"
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
d=[]
judge=True
bag=[]
for i in range(n):
    a,b=map(int,input().split())
    d.append([a,b])
d.sort(key=itemgetter(1))
        
for j in range(len(d)):
    bag.append(d[j][0])
    if sum(bag)>d[j][1]:
        judge=False
else:
    if judge==True:
        print("Yes")
    else:
        print("No")

Fixed submission:
n=int(input())
bag=[]
ans="Yes"
total=0
for i in range(n):
    a,b=map(int,input().split())
    bag.append([a,b])
d=sorted(bag, key=lambda x:x[1])

for j in range(n):
    total=total+d[j][0]
    if total>d[j][1]:
        ans="No"
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    d=d+L[i-1]
print(c)
    

Fixed submission:
n,x=map(int,input().split())
L=list(map(int,input().split()))
d=0
c=0
for i in range(1,n+2):
    if d<=x:
        c+=1
    if i<n+1:
        d=d+L[i-1]
print(c)
Buggy python submission (verdict: Runtime Error):

S=input()
hantei=False
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False
SS=sorted(S)

if(hantei==True):
    print("Yes")
else:
    print("No")
    

Fixed submission:
S=input()
hantei=False
SS=sorted(S)
if(len(set(S))==2):
    if(SS[0]==SS[1] and SS[0]!=SS[2]):
        hantei=True
    else:
        hantei=False
else:
    hantei=False


if(hantei==True):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
v = [n for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")


Fixed submission:
s = [n for n in input()];r = len(set(s)) == 2 and ((s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]));print("Yes" if r else "No")

Buggy python submission (verdict: Runtime Error):
v = [int(n) for n in input()];s = [n for n in input()];r = (s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]);print("Yes" if r else "No")


Fixed submission:
s = [n for n in input()];r = len(set(s)) == 2 and ((s[0] == s[1] and s[2] == s[3]) or (s[0] == s[2] and s[1] == s[3]) or (s[0] == s[3] and s[1] == s[2]));print("Yes" if r else "No")
Buggy python submission (verdict: Runtime Error):
print(sum([max([int(n) for n in input().strip().split()])-a for a in [0,1]]))

Fixed submission:
nm = [int(n) for n in input().split()];nm.extend([n-1 for n in nm]);nm.sort();nm.reverse();print(sum(nm[:2]));
Buggy python submission (verdict: Runtime Error):
("Christmas " + (25 - (int(input())) * "Eve ")).strip()

Fixed submission:
print(("Christmas "+((25-(int(input())))*"Eve ")).strip())
Buggy python submission (verdict: Runtime Error):
x = int(input())
z = list(map(int,input().split()))
i = 1
num = 0
while i+1 < x:
    if z[i-1] < z[i] < z[i+1]:
        num += 1
    elif z[i+1] < z[i] < z[i-1]:
        num += 1
    i += 1
print(num)

Fixed submission:
y=input()
 
if y[0]==y[1] and y[2]==y[3]:
    if y[1]==y[2]:
        print("No")
    else:
        print("Yes")
elif y[0]==y[2] and y[1]==y[3]:
    if y[1]==y[2]:
        print("No")
    else:
        print("Yes")
elif y[0]==y[3] and y[1]==y[2]:
    if y[0]==y[2]:
        print("No")
    else:
        print("Yes")   
    
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input().split()
n=int(s[0])
x=int(s[1])
j=[]
d=input().split()
for i in range(n):
    j.append(int(d[i]))
d= 0
i=0
p=0
while d<=x:
    p+=1
    d+=j[i]
    i+=1
print(p)


Fixed submission:
s=input().split()
n=int(s[0])
x=int(s[1])
j=[]
d=input().split()
for i in range(n):
    j.append(int(d[i]))
d= 0
i=0
p=0
while d<=x:
    p+=1
    if i<=len(j)-1:
        d+=j[i]
    else:
        break
    i+=1
print(p)
Buggy python submission (verdict: Runtime Error):
i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Fixed submission:
s  = input()
t  = input()
u = input()

slice1 = s[0:1]
slice2 = t[1:2]
slice3 = u[2:3]

ans = slice1 + slice2 + slice3

print(ans)
Buggy python submission (verdict: Runtime Error):
i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A-1,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

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

count = 0
for i in range (A,B,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

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

a = str(A)
b = str(B)

count = 0
for i in range (A,B,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)
Buggy python submission (verdict: Runtime Error):
s1,s2,s3 = (int(x) for x in input().split())

count1 = 0
for i in range(1,4,1):
    if s1 == 1:
        count1 = count1 + 1
    else:
        pass
    
print(count1)

Fixed submission:
import numpy as np

s1s2s3=int(input())

count1 = 0

num = []

while s1s2s3 != 0:
    num.append(s1s2s3 % 10)
    s1s2s3 //= 10
num.reverse()

for i in range (len(num)):
    if  num[i-1] == 1:
        count1 = count1 + 1
    else:
        pass

print(count1)
Buggy python submission (verdict: Runtime Error):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])

Fixed submission:
s=input()
d={}
for ss in s:
  d[ss]=0
for ss in s:
  d[ss]+=1
if len(d.keys())==2:
  f=True
  for k in d:
    if d[k]!=2:
      f=False
  if f :
    print("Yes")
  else:
    print("No")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[n/2]-s[n/2-1])

Fixed submission:
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [*map(int, input().split())]
cnt = 0

for i in range(1, len(l)-1):
    sub = sorted([l[i-1], l[i], l[i+1]])
    
    if sub[1] == l[i]:
        cnt += 1

print(cnt)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
cnt = 0

for i in range(1, len(l)-1):
    sub = sorted([l[i-1], l[i], l[i+1]])
    
    if sub[1] == l[i]:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print('Hello World')
else:
    print(A+B)

Fixed submission:
N = int(input())

if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b:
        return gcd(b, a%b)
    else:
        return a

#input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = [*map(int, input().split())]
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)

Fixed submission:
def gcd(a, b):
    if b:
        return gcd(b, a%b)
    else:
        return a

#input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = list(map(int, input().split()))
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    if b:
        return gcd(b, a%b)
    else:
        return a

input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = [*map(int, input().split())]
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)

Fixed submission:
def gcd(a, b):
    if b:
        return gcd(b, a%b)
    else:
        return a

#input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = list(map(int, input().split()))
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)

Buggy python submission (verdict: Runtime Error):
from math import gcd

input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = [*map(int, input().split())]
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)

Fixed submission:
def gcd(a, b):
    if b:
        return gcd(b, a%b)
    else:
        return a

#input = __import__('sys').stdin.readline
N, X = map(int, input().split())
l = list(map(int, input().split()))
res = -1

for i in range(N):
    d = abs(l[i] - X)
    
    if res == -1:
        res = d
    else:
        res = gcd(res, d)

print(res)
Buggy python submission (verdict: Runtime Error):
input()
l = [*map(int, input().split())]
print(max(l)-min(l))

Fixed submission:
input()
l = list(map(int, input().split()))
print(max(l)-min(l))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
st = []
ch = []

for i in range(N):
    st.append([*map(int, input().split())])

for i in range(M):
    ch.append([*map(int, input().split())])

for i in range(N):
    x = float('inf')
    c = 0
    
    for j in range(M):
        if abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1]) < x:
            x = abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1])
            c = j+1
    
    print(c)

Fixed submission:
N, M = map(int, input().split())
st = []
ch = []

for i in range(N):
    st.append(list(map(int, input().split())))

for i in range(M):
    ch.append(list(map(int, input().split())))

for i in range(N):
    x = float('inf')
    c = 0
    
    for j in range(M):
        if abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1]) < x:
            x = abs(st[i][0]-ch[j][0])+abs(st[i][1]-ch[j][1])
            c = j+1
    
    print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = [*map(int, input().split())]

for i in range(int(input())):
    P, X = map(int, input().split())
    t = 0
    
    for j in range(N):
        if j+1 == P: t += X
        else: t += T[j]
    
    print(t)

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

for i in range(int(input())):
    P, X = map(int, input().split())
    t = 0
    
    for j in range(N):
        if j+1 == P: t += X
        else: t += T[j]
    
    print(t)

Buggy python submission (verdict: Runtime Error):
N = int(input())
T = [*map(int, input().split())]

for i in range(int(input())):
    P, X = map(int, input().split())
    t = 0
    
    for j in range(N):
        if j+1 == P: t += X
        else: t += T[j]
    
    print(t)

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

for i in range(int(input())):
    P, X = map(int, input().split())
    t = 0
    
    for j in range(N):
        if j+1 == P: t += X
        else: t += T[j]
    
    print(t)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
d = list(map(int, input().split(' ')))
c = 0
mid = (max(d) + min(d))//2
for i in range(mid//2, mid*2):
    a = sum([1 for val in d if val < i])
    b = sum([1 for val in d if val >= i])
    if a == b:
        c += 1
print(c)

Fixed submission:
N = int(input())
d = list(map(int, input().split(' ')))
d.sort()

print( d[N//2] - d[N//2 - 1] )
Buggy python submission (verdict: Runtime Error):
S = input()
#print(S)
#i = 0
for e in S:
    if e=="+":
        i=+1
    else:
        i-=1
print(i)


Fixed submission:

S = input()
#print(S)
i = 0
for e in S:
    if e=="+":
        i=i+1
    if e=="-":
        i=i-1
print(i)
Buggy python submission (verdict: Runtime Error):
try:
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
except EOFError:
    pass


Fixed submission:
try:
    s = input()
    if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
        print('Bad')
    else:
        print('Good')
except EOFError:
    pass
Buggy python submission (verdict: Runtime Error):
b = input()

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

Fixed submission:
b = input()

if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "G":
    print("C")
else:
    print("G")
Buggy python submission (verdict: Runtime Error):
S = input()
S = S.split()
howMuch = S[0]
Ihave = S[1]
sutis = S[2]
 
if (Ihave // howMuch) < sutis:
    print(Ihave // howMuch)
else:
    print(sutis)

Fixed submission:
S = input()
S = S.split()
howMuch = int(S[0])
Ihave = int(S[1])
sutis = int(S[2])
 
if (Ihave // howMuch) < sutis:
    print(Ihave // howMuch)
else:
    print(sutis)

Buggy python submission (verdict: Runtime Error):
S = input()
S = S.split()
howMuch = S[0]
Ihave = S[1]
sutis = S[2]
 
ans = int(Ihave)/int(howMuch)
ans2 = int(sutis) * int(howMuch)
if ans < sutis:
    print(int(sutis))
else:
    print(int(ans))

Fixed submission:
S = input()
S = S.split()
howMuch = int(S[0])
Ihave = int(S[1])
sutis = int(S[2])
 
if (Ihave // howMuch) < sutis:
    print(Ihave // howMuch)
else:
    print(sutis)
Buggy python submission (verdict: Time Limit Exceeded):
N = input()

ans = 0
while(True):
    changeFlg = False
    for a in range(len(N)-1):
        if N[a] != N[a + 1]:
            N = N[0:a] + N[a+2 : len(N)]
            ans += 2
            changeFlg = True
            break
    if  changeFlg == False:
        break

print(ans)

Fixed submission:
S = input()
s = ['01', '10']
 
ans = 0
count = len(S)
i = 0
while count >= 2:
    if S[i:i + 2] in s:
        S = S[:i] + S[i + 2:]
        ans += 2
        count -= 1
        i -= 1
    else:
        i += 1
        count -= 1
 
print(ans)
Buggy python submission (verdict: Runtime Error):
apple = int(input('りんごの個数') * 3)
piece = int(input('りんごの破片の数'))

apple_pie = (apple + piece) // 2
print(apple_pie)

Fixed submission:
A, P = [int(i) for i in input().split()]
print((A * 3 + P) // 2)
Buggy python submission (verdict: Runtime Error):
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print((C(i - 1, k - 1, mod) * C(n - k - i + 1, n - k + 1, mod))%mod)


Fixed submission:
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    if n + 1 - k - i >= 0:
        print((C(i - 1, k - 1, mod) * C(i, n - k + 1, mod)) % mod)
    else:
        print(0)

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


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print(C(i - 1, k - 1, mod) * C(n - k - i + 1, n - k + 1, mod))


Fixed submission:
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    if n + 1 - k - i >= 0:
        print((C(i - 1, k - 1, mod) * C(i, n - k + 1, mod)) % mod)
    else:
        print(0)

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


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    print(C(i - 1, k - 1, mod) * C(i, n - k + 1, mod))


Fixed submission:
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    if n + 1 - k - i >= 0:
        print((C(i - 1, k - 1, mod) * C(i, n - k + 1, mod)) % mod)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb, factorial

n, k = tuple(map(int, input().split(' ')))
for i in range(1, k+1):
  s = comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) / (factorial(n-k-i+1, exact=True) * factorial(i, exact=True)))
  print(int(s) % (10 ** 9 + 7))

Fixed submission:
input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb, factorial

try:
  n, k = tuple(map(int, input().split(' ')))
  for i in range(1, k+1):
    print(comb(k-1, i-1, exact=True) * (factorial(n-k+1, exact=True) // (factorial(n-k-i+1, exact=True) * factorial(i, exact=True))) % (10 ** 9 + 7))
except Exception as e:
  print(e)

Fixed submission:
input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')

Buggy python submission (verdict: Runtime Error):
input_str = input()
items = set(list(input_str)
return 'Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No'

Fixed submission:
input_str = input()
items = set(list(input_str))
print('Yes' if len(items) == 2 and len(list(input_str.replace(list(items)[0], ''))) == 2 else 'No')
Buggy python submission (verdict: Runtime Error):
S = str(input())
s = list(S)
if s[0] == s[1]:
    if s[2] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[2]:
    if s[1] == s[3]:
        print("Yes")
    else:
        print("No")
else if s[0] == s[3]:
    if s[1] == s[2]:
        print("Yes")
    else:
        print("No")

Fixed submission:
S = str(input())
s = list(S)

if s[0] == s[1] == s[2] == s[3]:
    print("No")
elif s[0] == s[1] and s[2] == s[3]:
        print("Yes")
elif s[0] == s[2] and s[1] == s[3]:
        print("Yes")
elif s[0] == s[3] and s[1] == s[2]:
        print("Yes")
else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
lcm_cd = (c * d) // math.gcd(c, d)
total = b - a + 1
d_c = b // c - (a - 1) // c
d_d = b // d - (a - 1) // d
d_cd = b // lcm_cd - (a - 1) // lcm_cd
print(int(total - (d_c + d_d - d_cd)))

Fixed submission:
import fractions

a, b, c, d = map(int, input().split())
lcm_cd = (c * d) // fractions.gcd(c, d)
total = b - a + 1
d_c = b // c - (a - 1) // c
d_d = b // d - (a - 1) // d
d_cd = b // lcm_cd - (a - 1) // lcm_cd
print(int(total - (d_c + d_d - d_cd)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
cost = 0
points = []
for i in range(n):
    xy = input().split()
    x = int(xy[0])
    y = int(xy[1])
    points.append((x,y))
#points.sort()
while len(points) != 0:
    p = points[-1][0] - points[-2][0]
    q = points[-1][1] - points[-2][1]
    xn = points[-1][0] - p
    yn = points[-1][1] - q
    cost +=1
    points.pop()
    print(p, " ", q)
    while len(points) != 0:
        if points[-1][0] == xn and points[-1][1] == yn:
            xn = points[-1][0] - p
            yn = points[-1][1] - q
            points.pop()
        else:
            break

print(cost)
    

Fixed submission:
import sys
data = sys.stdin.readlines()
data = data[0].split()
N = int(data[0])
K = int(data[1])
if K == 1:
    print(0)
else:
    print(N-K)