Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())

X = []

i = 0
while i < N:
    X.append(list(map(int, input().split())))
    i += 1

X = np.asarray(X)

X_ind = np.argsort(X[:,0], axis=0)
X = X[X_ind]
# print(X)
least = 1
p = 0
while least <= M:
    # print(least)
    best_index = -1
    best_s = 0
    for i in range(X.shape[0]):
        target = X[i]
        if least >= target[0] and best_s <= target[1]:
            best_index = i
            best_s = target[1]
        elif least < target[0]:
            break
    # print(target)
    p += best_s
    if best_index >= 0:
        X = np.delete(X, best_index, axis=0)
    least += 1

print(p)


Fixed submission:
from heapq import heappush,heappop
N, M = map(int, input().split())

X = []

for _ in range(N):
    a, b = map(int, input().split())
    if a <= M:
        X.append((a,b))


X = sorted(X, key=lambda x:(x[0], x[1]), reverse=True)

# print(X)
q = []
ans = 0
for i in range(1, M + 1):
    while X and X[-1][0] <= i:
        _, b = X.pop()
        heappush(q, -b)
    if q:
        ans -= heappop(q)
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())

X = []

i = 0
while i < N:
    X.append(list(map(int, input().split())))
    i += 1

X = np.asarray(X)

X_ind = np.argsort(X[:,1], axis=0)
X = X[X_ind]
# print(X)
least = 1
p = 0
while least <= M:
    # print(least)
    best_index = -1
    best_s = 0
    for i in range(X.shape[0]):
        target = X[i]
        if least >= target[0] and best_s <= target[1]:
            best_index = i
            best_s = target[1]
    # print(target)
    p += best_s
    if best_index >= 0:
        X = np.delete(X, best_index, axis=0)
    least += 1

print(p)


Fixed submission:
from heapq import heappush,heappop
N, M = map(int, input().split())

X = []

for _ in range(N):
    a, b = map(int, input().split())
    if a <= M:
        X.append((a,b))


X = sorted(X, key=lambda x:(x[0], x[1]), reverse=True)

# print(X)
q = []
ans = 0
for i in range(1, M + 1):
    while X and X[-1][0] <= i:
        _, b = X.pop()
        heappush(q, -b)
    if q:
        ans -= heappop(q)
        
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())

X = []

i = 0
while i < N:
    X.append(list(map(int, input().split())))
    i += 1

X = np.asarray(X)

X_ind = np.lexsort((X[:,0], -X[:,1]), axis=0)[::-1]
X = X[X_ind]
# print(X)
least = M - 1
p = 0
while least >= 0:
    last, X = X[-1], X[:-1]
    # print(last, X)
    if (M - least) >= last[0]:
        p += last[1]
        least -= 1

print(p)


Fixed submission:
from heapq import heappush,heappop
N, M = map(int, input().split())

X = []

for _ in range(N):
    a, b = map(int, input().split())
    if a <= M:
        X.append((a,b))


X = sorted(X, key=lambda x:(x[0], x[1]), reverse=True)

# print(X)
q = []
ans = 0
for i in range(1, M + 1):
    while X and X[-1][0] <= i:
        _, b = X.pop()
        heappush(q, -b)
    if q:
        ans -= heappop(q)
        
print(ans)
Buggy python submission (verdict: Runtime Error):
L = list(input())
L_ = []
a = L.pop(0)
cnt = 0

while True:
    if len(L) == 0:
        break
    else:
        b = L.pop(0)
    if a is not b:
        cnt += 1
        # L = L_ + L
        # L_ = []
        a = L_.pop(0)
    elif a is b:
        L_.append(a)
        a = b
    # print(L_, a,  L)

print(cnt * 2)



Fixed submission:
a, b, c = map(int, input().split())
res = b // a
if res > c:
  res = c
print(res)
Buggy python submission (verdict: Runtime Error):
L = list(input())
L_ = []
a = L.pop(0)
cnt = 0

while True:
    if len(L) == 0:
        break
    else:
        b = L.pop(0)
    if a is not b:
        cnt += 1
        if len(L_) != 0:
            a = L_.pop()
        else:
            a = L.pop(0)
    elif a is b:
        L_.append(a)
        a = b
    # print(L_, a,  L)

print(cnt * 2)



Fixed submission:
L = list(input())
L_ = []
a = L.pop(0)
cnt = 0

while True:
    if len(L) == 0:
        break
    else:
        b = L.pop(0)
    if a is not b:
        cnt += 1
        if len(L_) != 0:
            a = L_.pop()
        elif len(L) == 0:
            break  
        else:
            a = L.pop(0)
    elif a is b:
        L_.append(a)
        a = b
    # print(L_, a,  L)

print(cnt * 2)

Buggy python submission (verdict: Runtime Error):
L = list(input())
L_ = []
a = L.pop(0)
cnt = 0

while True:
    if len(L) == 0:
        break
    else:
        b = L.pop(0)
    if a is not b:
        cnt += 1
        L = L_ + L
        L_ = []
        a = L.pop(0)
    elif a is b:
        L_.append(a)
        a = b
    # print(L_, a,  L)

print(cnt * 2)



Fixed submission:
L = list(input())
L_ = []
a = L.pop(0)
cnt = 0

while True:
    if len(L) == 0:
        break
    else:
        b = L.pop(0)
    if a is not b:
        cnt += 1
        if len(L_) != 0:
            a = L_.pop()
        elif len(L) == 0:
            break  
        else:
            a = L.pop(0)
    elif a is b:
        L_.append(a)
        a = b
    # print(L_, a,  L)

print(cnt * 2)
Buggy python submission (verdict: Runtime Error):
a, b = input().split(' ')
index = a + b
if(a - b > index):
  index = a - b
elif(a * b > index):
  index = a * b
print(index)

Fixed submission:
a, b = map(int, input().split(' '))
ans = max(a+b, a-b, a*b)
print(ans)
Buggy python submission (verdict: Runtime Error):
a = 2000001
b = 1000000
k, x = map(int, input().split())

if(k == 1):
    print(x)
else:
    ans = [i for i in range(x-k+1, x+k-1)]
    print(" ".join(ans))


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

if(k == 1):
    print(x)
else:
    ans = [i for i in range(x-k+1, x+k)]
    print(" ".join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
a, b = map(int input().split())
print(max(a + b, a - b, a * b))

Fixed submission:
a, b = map(int, input().split())
print(max(a + b, a - b, a * b))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
l = []
for i in range(N):
  a, b = map(int, input().split())
  for j in range(b):
      l.append(a)
print(sorted(l)[K-1])

Fixed submission:
N, K = map(int, input().split())
l = [0 for i in range(100001)]
num_count = 0
n = 0
for j in range(N):
    a, b = map(int, input().split())
    l[a] += b
for k in l:
    num_count += k
    if num_count >= K:
        print(n)
        break
    else:
        n += 1
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
mod = 10 ** 9 + 7
power = 1
for i in range(N):
    power = power * (i + 1)
print(power % mod)

Fixed submission:
N = int(input())
mod = 10 ** 9 + 7
power = 1
for i in range(N):
    power = power * (i + 1) % mod
print(power)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit
N = int(input())
A = list(map(int, input().split()))
if N % 2 == 0:
    for i in range(N // 2):
        if A.count(i * 2 + 1) != 2:
            print(0)
            exit()
        else:
            continue
    print(int(2 ** (N / 2)) % (10 ** 9 + 7))
else:
    n = 0
    if A.count(0) != 1:
        print(0)
        exit()
    else:
        for i in range(N // 2):
            if A.count(i * 2 + 2) != 2:
                print(0)
                exit()
            else:
                continue
    print(int(2 ** (N // 2)) % (10 ** 9 + 7))
  

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
a_comb = []
mod = 10 ** 9 + 7

for i in range(N):
    a_comb.append(abs(i - (N - 1 - i)))

if sorted(a_comb) == sorted(a):
    print(2 ** (N // 2) % mod)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
string = [input() for s in range(N[1])]
string.sort()
print(''.join(string))


Fixed submission:
N = list(map(int, input().split()))
string = [input() for s in range(N[0])]
string.sort()
print(''.join(string))

Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
string = [input() for s in range(N[1])]
string.sort()
print(string)
    

Fixed submission:
N = list(map(int, input().split()))
string = [input() for s in range(N[0])]
string.sort()
print(''.join(string))
Buggy python submission (verdict: Runtime Error):
# your code goes here
a, b = int(input().split())
c1 = a+b
c2 = a-b
c3 = a*b
if c1>c2 and c1>c3:
	print(c1)
elif c2>c3:
	print(c2)
else:
	print(c3)

Fixed submission:
# your code goes here
a, b = map(int,input().split())
c1 = a+b
c2 = a-b
c3 = a*b
if c1>c2 and c1>c3:
	print(c1)
elif c2>c3:
	print(c2)
else:
	print(c3)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(str(max(c-a+b,0))

Fixed submission:
a,b,c=map(int,input().split())
print(str(max(c-a+b,0)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = [int(i) for i in input().split()]

for i in range(n):
    a = x[:]
    del a[i]
    a.sort()
    print(a[int(n/2)-1])

Fixed submission:
n = int(input())
x = [int(i) for i in input().split()]
a = x[:]
a.sort()

mid = n //2
m1 = a[mid-1]
m2 = a[mid]
for i in range(n):
    if x[i] <= m1:
        ans = m2
    else:
        ans = m1
 
    print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(i) for i in input().split()]

for i in range(n):
    a = x[:]
    del a[i]
    a.sort()
    print(a[(n-1)/2-1])


Fixed submission:
n = int(input())
x = [int(i) for i in input().split()]
a = x[:]
a.sort()

mid = n //2
m1 = a[mid-1]
m2 = a[mid]
for i in range(n):
    if x[i] <= m1:
        ans = m2
    else:
        ans = m1
 
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = [int(i) for i in input().split()]

for i in range(n):
    a = x[:]
    del a[i]
    a.sort()
    print(a[int((len(a)+1)/2)-1])

Fixed submission:
n = int(input())
x = [int(i) for i in input().split()]
a = x[:]
a.sort()

mid = n //2
m1 = a[mid-1]
m2 = a[mid]
for i in range(n):
    if x[i] <= m1:
        ans = m2
    else:
        ans = m1
 
    print(ans)
Buggy python submission (verdict: Runtime Error):
x, a, b = (int(i) for i in input().split())
if abs(x-a) < abs(x-b):
    print(A)
else:
    print(B)

Fixed submission:
x, a, b = (int(i) for i in input().split())
if abs(x-a) < abs(x-b):
    print('A')
else:
    print('B')
Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = args[1]
str = list(str)
ans = alphabet

for i in str:
    try:
        ans.remove(i)
    except:
        continue
try:
    print(ans[0])
except:
    print("None")

Fixed submission:
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = input()
str = list(str)
ans = alphabet

for i in str:
    try:
        ans.remove(i)
    except:
        continue
try:
    print(ans[0])
except:
    print("None")

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

args = sys.argv
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = args[1]
str = list(str)
ans = alphabet

for i in str:
    ans.remove(i)

try:
    print(ans[0])
except:
    print("None")

Fixed submission:
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = input()
str = list(str)
ans = alphabet

for i in str:
    try:
        ans.remove(i)
    except:
        continue
try:
    print(ans[0])
except:
    print("None")

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

args = sys.argv
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = args[1]
ans = alphabet

for i in alphabet:
    if i in str:
        ans.remove(i)

print(ans[0])

Fixed submission:
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = input()
str = list(str)
ans = alphabet

for i in str:
    try:
        ans.remove(i)
    except:
        continue
try:
    print(ans[0])
except:
    print("None")

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

args = sys.argv
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = args[1]
ans = alphabet

for i in alphabet:
    if i in str:
        ans.remove(i)

print(ans[0])

Fixed submission:
alphabet = ([chr(ord('a') + i) for i in range(26)])
str = input()
str = list(str)
ans = alphabet

for i in str:
    try:
        ans.remove(i)
    except:
        continue
try:
    print(ans[0])
except:
    print("None")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
# スペース区切りの整数の入力
ar = []
for i in range(n):
  ar.append("".join(sorted(input())))

#for t in ar:
#  print(t)
#for i in range(n):
#  for j in range(i+1, n):
#    if ar[i] == ar[j]:
#      ar[j] = ar[i]

count = 0
#for i in range(n):
#  for j in range(i+1, n):
#    if ar[i] is ar[j]:
#      count = count + 1

for i in range(n):
  count = count + ar[i+1:].count(ar[i])

print(count)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
print("{}".format(max(max(a+b, a-b), a*b)))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
print("{}".format(max(max(a+b, a-b), a*b))

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
print("{}".format(max(max(a+b, a-b), a*b)))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
# 文字列の入力
s = input()
# 出力
print("{}".format(c-(a-b)))

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
# 文字列の入力
# 出力
print("{}".format(c-(a-b) if (c-(a-b)) > 0 else 0))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b, c = map(int, input().split())
print("{}".c-(a-b))

Fixed submission:
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
# 文字列の入力
# 出力
print("{}".format(c-(a-b) if (c-(a-b)) > 0 else 0))
Buggy python submission (verdict: Runtime Error):
import heapq

n, m = map(int, input().split(' '))
works = [[] for _ in range(100001)]

for i in range(n):
    a, b = map(int, input().split(' '))
    heapq[a].append(b)

ans = 0
h = []
for day in range(1, m + 1):
    for gain in works[day]:
        heapq.heappush(h, -gain)

    if h:
        gain = -heapq.heappop(h)
        ans += gain

print(ans)
    


Fixed submission:
from collections import deque
import heapq

n, m = map(int, input().split(' '))
works = [[] for _ in range(100001)]

for i in range(n):
    a, b = map(int, input().split(' '))
    works[a].append(b)

ans = 0
h = []
for day in range(1, m + 1):
    for gain in works[day]:
        heapq.heappush(h, -gain)


    if h:
        gain = -heapq.heappop(h)
        ans += gain


print(ans)
Buggy python submission (verdict: Runtime Error):
def distance(a, b):
    s = 0
    for i in range(len(a)):
        s += (a[i] - b[i]) ** 2

    return s ** 0.5

N,D = map(int,input().split())

X = []

for i in range(D):
    X.append([int(x) for x in input().split()])

count = 0

for i in range(D):
    for j in range(i+1, D):
        if distance(X[i], X[j]).is_integer():
            count += 1

print(count)

Fixed submission:
def distance(a, b):
    s = 0
    for i in range(len(a)):
        s += (a[i] - b[i]) ** 2

    return s ** 0.5

N,D = map(int,input().split())

X = []

for i in range(N):
    X.append([int(x) for x in input().split()])

count = 0

for i in range(N):
    for j in range(i+1, N):
        if distance(X[i], X[j]).is_integer():
            count += 1

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

tasu = a+b
kakeru = a*b
hiku = a-b

print(max(tasu,kakeru,hiku))

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

tasu = a+b
kakeru = a*b
hiku = a-b

print(max(tasu,kakeru,hiku))

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

tasu = a+b
kakeru = a*b
hiku = a-b

print(max(tasu,kakeru,hiku))

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

tasu = a+b
kakeru = a*b
hiku = a-b

print(max(tasu,kakeru,hiku))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(int(input()) for _ in range(n))

num = max(a)
try:
    num2 = max([k for k in a if k != num])
except:
    pass
for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Fixed submission:
n = int(input())
a = list(int(input()) for _ in range(n))

max_list = sorted(a,reverse=True)[:2]
num = max_list[0]
num2 = max_list[1]

for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(int(input()) for _ in range(n))

num = max(a)
num2 = max([k for k in a if k != num])
for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Fixed submission:
n = int(input())
a = list(int(input()) for _ in range(n))

max_list = sorted(a,reverse=True)[:2]
num = max_list[0]
num2 = max_list[1]

for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(int(input()) for _ in range(n))

num = max(a)
for i in range(n):
    if a[i] < num:
        print(num)
    else:
        b = a.copy()
        int(b.pop(i))
        print(max(b))

Fixed submission:
n = int(input())
a = list(int(input()) for _ in range(n))

max_list = sorted(a,reverse=True)[:2]
num = max_list[0]
num2 = max_list[1]

for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(int(input()) for _ in range(n))

num = max(a)
for i in range(n):
    if a[i] < num:
        print(num)
    else:
        b = a.copy()
        int(b.pop(i))
        print(max(b))

Fixed submission:
n = int(input())
a = list(int(input()) for _ in range(n))

max_list = sorted(a,reverse=True)[:2]
num = max_list[0]
num2 = max_list[1]

for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(int(input()) for _ in range(n))

for i in range(n):
    b = a.copy()
    int(b.pop(i))
    print(max(b))

Fixed submission:
n = int(input())
a = list(int(input()) for _ in range(n))

max_list = sorted(a,reverse=True)[:2]
num = max_list[0]
num2 = max_list[1]

for i in range(n):
    if a[i] < num:
        print(num)
    else:
        print(num2)
Buggy python submission (verdict: Runtime Error):
import sys

n = int(input()) 
s = list(input()) 
k = int(input()) 

word = s[k]
for i in s:
    if i != word:
        sys.stdout.write('*')
    else:
        sys.stdout.write(i)

Fixed submission:
import sys

n = int(input()) 
s = list(input()) 
k = int(input()) 

word = s[k-1]
for i in s:
    if i != word:
        sys.stdout.write('*')
    else:
        sys.stdout.write(i)
Buggy python submission (verdict: Runtime Error):
S = list(input())

num = 0
num_list = []
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
    else:
        num_list.append(num)
        num = 0
print(max(num_list))

Fixed submission:
S = list(input())

num = 0
num_list = [0]
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
        num_list.append(num)
    else:
        num_list.append(num)
        num = 0
print(max(num_list))

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

num = 0
num_list = []
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
    else:
        num_list.append(num)
        num = 0
print(max(num_list))

Fixed submission:
S = list(input())

num = 0
num_list = [0]
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
        num_list.append(num)
    else:
        num_list.append(num)
        num = 0
print(max(num_list))

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

num = 0
num_list = []
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
    else:
        num_list.append(num)
print(max(num_list))

Fixed submission:
S = list(input())

num = 0
num_list = [0]
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
        num_list.append(num)
    else:
        num_list.append(num)
        num = 0
print(max(num_list))
Buggy python submission (verdict: Runtime Error):
A,B,C=map(input().split())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)


Fixed submission:
A,B,C=map(int,input().split())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
A,B,C=map(input().strip())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)


Fixed submission:
A,B,C=map(int,input().split())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
A,B,C=map(input().strip())
print(C-A+B)

Fixed submission:
A,B,C=map(int,input().split())
can=(A-B)
if (C-can)>0:
    print(C-can)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())

s = []
for i in range(N):
    s.append(''.join(sorted(input())))

s = sorted(s)

tmp_count = 1
count = 0
for i in range(0, len(s)-1):
    if s[i] == s[i+1]:
        tmp_count += 1
    else:
        count += tmp_count * (tmp_count - 1) // 2
        tmp_count = 1
count += tmp_count * (tmp_count - 1) // 2
print(count)

Fixed submission:
#AtCoder Beginner Contest 127
array = list(map(int, input().split()))

plus = array[0] + array[1]
minus = array[0] - array[1]
product = array[0] * array[1]

print(max(plus, minus, product))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
dif = np.array(list(map(int, input().split())))
divide = 0
for k in range(min(dif), max(dif)+1):
    count_over = 0
    count_under = 0
    for i in range(len(dif)):
        if dif[i] >= k:
            count_over += 1
        else:
            count_under += 1
    if count_over == count_under:
        divide += 1
print(divide)

Fixed submission:
s = input()

if s[0] == s[1] and s[2] == s[3] and s[1] != s[2]:
    print('Yes')
elif s[0] == s[2] and s[1] == s[3] and s[1] != s[2]:
    print('Yes')
elif s[0] == s[3] and s[1] == s[2] and s[1] != s[3]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
dif = np.array(list(map(int, input().split())))
divide = 0
for k in range(min(dif), max(dif)+1):
    count_over = 0
    count_under = 0
    for i in range(len(dif)):
        if dif[i] >= k:
            count_over += 1
        else:
            count_under += 1
    if count_over == count_under:
        divide += 1
print(divide)

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

divide = 0

medium = int((len(dif)) / 2)


if (len(dif)) %2 != 0:
    print(divide)
else:
    divide = dif[medium] - dif[medium-1]
    print(divide)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
dif = list(map(int, input().split()))
divide = 0
for k in range(min(dif), max(dif)+1):
    count_over = 0
    count_under = 0
    for i in range(len(dif)):
        if dif[i] >= k:
            count_over += 1
        else:
            count_under += 1
    if count_over == count_under:
        divide += 1
print(divide)

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

divide = 0

medium = int((len(dif)) / 2)


if (len(dif)) %2 != 0:
    print(divide)
else:
    divide = dif[medium] - dif[medium-1]
    print(divide)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
b = int(input())

# 出力
print(max([a+b, a-b, a*b]))

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b = map(int, input().split())

# 出力
print(max([a+b, a-b, a*b]))

Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(sort([a+b,a-b,a*b][-1]))

Fixed submission:
a,b=map(int, input().split())
print(sorted([a+b,a-b,a*b])[-1])
Buggy python submission (verdict: Runtime Error):
a,b = [int(i) for i in input()]

print(max([a + b, a - b, a * b]))

Fixed submission:
a, b = [int(i) for i in input().split()]

print(max([a + b, a - b, a * b]))