Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
string = input()
ones = 0
zeros = 0
for s in string:
  if s == '1':
    ones += 1
  else:
    zeroes += 1
print(2*min(ones, zeros))

Fixed submission:
string = input()
ones = 0
zeros = 0
for s in string:
  if s == '1':
    ones += 1
  else:
    zeros += 1
print(2*min(ones, zeros))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import numpy as np

N, i = map(int, raw_input().split() )
print n-1 + 1

Fixed submission:
# -*- coding: utf-8 -*-
# Luis Yoichi Morales January 2019

from sys import stdin
import numpy as np

N, i = map(int, raw_input().split() )
print N-i + 1
Buggy python submission (verdict: Runtime Error):
R, G, B, N = map(int,input().split())
ans = 0
for r in range(N//R + 1):
  for g in range((N - r*R)//G + 1):
    if (N - rR - gG) % B == 0:
      ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int,input().split())
ans = 0
for r in range(N//R + 1):
  for g in range((N - r*R)//G + 1):
    if (N - r*R - g*G) % B == 0:
      ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
sum = 0
for i in range(1,2):
	if A <= B:
      sum += B
      B -= 1
    else:
      sum += A
      A -= 1
print(str(sum))

Fixed submission:
A,B = map(int, input().split())
sum = 0
for i in range(2):
  if A < B:
    sum += B
    B -= 1
  else:
    sum += A
    A -= 1
print(sum)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
sum = 0
for i in range(1,2):
	if a < b:
      sum += b
      b -= 1
    else:
      sum += a
      a -= 1
print('sum')

Fixed submission:
A,B = map(int, input().split())
sum = 0
for i in range(2):
  if A < B:
    sum += B
    B -= 1
  else:
    sum += A
    A -= 1
print(sum)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))
sum = 0
for i in range(1,2):
	if a < b:
      sum += b
      b -= 1
    else:
      sum += a
      a -= 1
print('sum')

Fixed submission:
A,B = map(int, input().split())
sum = 0
for i in range(2):
  if A < B:
    sum += B
    B -= 1
  else:
    sum += A
    A -= 1
print(sum)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
sum = 0
for i in range(1,2):
	if a < b:
      sum += b
      b -= 1
    else:
      sum += a
      a -= 1
print(sum)

Fixed submission:
A,B = map(int, input().split())
sum = 0
for i in range(2):
  if A < B:
    sum += B
    B -= 1
  else:
    sum += A
    A -= 1
print(sum)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))
sum = 0
for i in range(1,2):
	if a < b:
      sum += b
      b -= 1
    else:
      sum += a
      a -= 1
print(sum)

Fixed submission:
A,B = map(int, input().split())
sum = 0
for i in range(2):
  if A < B:
    sum += B
    B -= 1
  else:
    sum += A
    A -= 1
print(sum)
Buggy python submission (verdict: Runtime Error):
include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
  int N = 0;
  int K = 0;
  int A = 1;
  std::cin >> N;
  std::cin >> K;
  for(int i;i<N;i++){
  A*=i
  }
  for(int i;i<K;i++){
  A/=i
  }
  for(int i;i<N-K;i++){
  A/=i
  }
  
  std::cout << A << std::endl;
  return 0;
}

Fixed submission:
n,k=map(int,input().split())
print(n-k+1)

Buggy python submission (verdict: Runtime Error):
N, K = input().split()
print(N - (K - 1))

Fixed submission:
N, K = map(int, input().split())
print(N - (K - 1))
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
N = int(input())
V = [int(s) for s in input().split() if s.isdigit()]
C = [int(s) for s in input().split() if s.isdigit()]

maximum = 0
for select in range(1, N+1):
    for comb in combinations(range(N), select):
        value = 0
        for idx in comb:
            value += V[idx] - C[idx]
        if value > maximum:
            maximum = value
print(maximum)


Fixed submission:
N = int(input())
V = [int(s) for s in input().split() if s.isdigit()]
C = [int(s) for s in input().split() if s.isdigit()]
VC = [int(i - j) for i, j in zip(V, C)]

dp = [0 for _ in range(N+1)]
for i in range(N):
    dp[i+1] = max(dp[i], dp[i] + VC[i])
print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
ans = 0
 
for x in range(N // R + 1):
    Rx = R * x
    for y in range(N // G + 1):
        check = N - Rx - G * y
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
ans = 0

for x in range(N // R + 1):
    for y in range(N // G + 1):
        check = N - R * x - G * y
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
ans = 0
NpB = N//B
for x in range(N // R + 1):
	for y in range(N // G + 1):
		if (N - R * x - G * y) % B == 0 and 0 <= (N - R * x - G * y) // B <= NpB:
			ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
ans = 0
for x in range(N // R + 1):
	for y in range(N // G + 1):
		if (N - R * x - G * y) % B == 0 and 0 <= (N - R * x - G * y) // B <= N // B:
			ans += 1
print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())
ans = 0
 
for Rx in range(0, N+1, R):
    for Gy in range(0, N+1, G):
        check = N - Rx - Gy
        if check % B == 0 and 0 <= check // B <= N // B:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())
r = 0
g = 0
X = N - r*R - g*G
num = 0
while X >= 0:
	while X >= 0:
			if X % B == 0:
				num += 1
			r += 1
			X = N - r*R - g*G
	g += 1
	r = 0
	X = N - r * R - g * G
 
print(num)

Fixed submission:
N,K = map(int,input().split())
answer = int(N) - int(K) + 1
print(str(answer))

Buggy python submission (verdict: Runtime Error):
n = input("N:")
k = input("K:")
answer = int(n) - int(k) + 1
print(str(answer))

Fixed submission:
N,K = map(int,input().split())
answer = int(N) - int(K) + 1
print(str(answer))
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())
r = 0
g = 0
X = N - r*R - g*G
num = 0
while X >= 0:
	while X >= 0:
			if X % B == 0:
				num += 1
			r += 1
			X = N - r*R - g*G
	g += 1
	r = 0
	X = N - r * R - g * G
 
print(num)

Fixed submission:
R,G,B,N = map(int, input().split())
count = 0
for r in range(N // R + 1) :
    for g in range((N - r*R) // G + 1) :
        if (N - r*R - g*G) %B == 0 :
            count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
R = int(input("R:"))
G = int(input("G:"))
B = int(input("B:"))
N = int(input("N:"))
r = 0
g = 0
X = N - r*R - g*G
num = 0
while X >= 0:
	while X >= 0:
			if X % B == 0:
				num += 1
			r += 1
			X = N - r*R - g*G
	g += 1
	r = 0
	X = N - r * R - g * G

print(num)

Fixed submission:
R,G,B,N = map(int, input().split())
count = 0
for r in range(N // R + 1) :
    for g in range((N - r*R) // G + 1) :
        if (N - r*R - g*G) %B == 0 :
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
D,N = map(int,input().split())

list = []
for i in range(10000000):
    if i % 100**D == 0:
        list.append(i)

print(list[N])


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

if N == 100:
    print(100**D*101)

else:
    print(100**D*N)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

p = 2
while p > 1:
    a = 1**2
    if a > X:
        p = 0
        a = a-1
        print(a)
    else:
        a += 1


Fixed submission:
X = int(input())

max = 1
temp = 1
for i in range(2,11,1): #指数部分
    for j in range(1,33,1):#整数部分

        temp = j**i
        if temp > 1000:
            break
        elif X >= temp and temp > max:
            max = temp

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

m = [int(input()) for i in range(N)]

m.sort()


dounut = 0#消費した素の量
count = 0 #追加で作った数
for i in range(N):
    dounut = dounut + m[i]

while dounut < X:
        dounut = dounut + m[0]
        count += 1

if dounut >  X:
    count -= 1

print(N + count)


Fixed submission:

a = input()

b = a.count("o")

print(700 + b*100)

Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split())
#N = ドーナツの種類
#X = お菓子の素
#m = 消費するお菓子の素の量

m = [int(input()) for i in range(N)]

m.sort()

#print(m)

dounut = 0#消費した素の量
count = 0 #追加で作った数
for i in range(N):
    dounut = dounut + m[i]
#print(dounut)

while dounut < X:
        dounut = dounut + m[0]
        count += 1
#        print(dounut)
#        print(count)

if dounut >  X:
    count -= 1

#print(count)

print(N + count)


Fixed submission:

a = input()

b = a.count("o")

print(700 + b*100)
Buggy python submission (verdict: Runtime Error):

A,B,K = map(int,input().split())

for i in range(K):
    if A+i <= B:
        print(A+i)

for i in range(K):
    if B-K+i >= A + K:
        print(B-K+i)


Fixed submission:

s = list(input())
s.sort()
if "".join(s) == "abc":
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
https://beta.atcoder.jp/contests/abc081/tasks/abc081_a

Fixed submission:
A = list(input())

print(A.count("1"))
Buggy python submission (verdict: Runtime Error):
n = input();
k = input();

n = int(n);
k = int(k);

ans = n - k + 1;
print (ans);

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

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)

Buggy python submission (verdict: Runtime Error):
n = input()
k = input()

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)

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

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)

Buggy python submission (verdict: Runtime Error):
n = input()
k = input()

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)


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

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)

Buggy python submission (verdict: Runtime Error):
n = input()
k = input()

ans = n - k + 1
print (ans)


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

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
a.sort()
print(pow(2, k) * a[2] + a[1] + a[0])

Fixed submission:
a = list(map(int, input().split()))
k = int(input())
a.sort()
print(pow(2, k) * a[2] + a[1] + a[0])
Buggy python submission (verdict: Runtime Error):
def solve(n,k):
  counter = 0
  for i in range(n,k,-1):
    theValue = n//i * (i-k) + max(n%i-k+1,0)
    counter += theValue
  return counter

c = list(map(int, input().split()))
print(solve(c[0], c[1]))

Fixed submission:
a = ""
for i in range(3):
  a += input()[i]

print(a)

Buggy python submission (verdict: Runtime Error):
def solve(n,k):
  counter = 0
  for i in range(n,k,-1):
    theValue = n//i * (i-k) + max(n%i-k+1,0)
    counter += theValue
  return counter

c = list(map(int, input().split()))
print(solve(c[0], c[1])

Fixed submission:
a = ""
for i in range(3):
  a += input()[i]

print(a)
Buggy python submission (verdict: Runtime Error):
def solve(n,k):
  counter = 0
  for i in range(n,k,-1):
    theValue = n//i * (i-k) + max(n%i-k , 0)
    counter += theValue
  return counter

c = list(map(int, input().split(' ')))
def(c[0], c[1])

Fixed submission:
def solve(n,k):
  counter = 0
  for i in range(n,k,-1):
    theValue = n//i * (i-k) + max(n%i-k+1,0)
    if (k == 0):
      theValue = max(theValue-1, 0)
    counter += theValue
  return counter

c = list(map(int, input().split()))
print(solve(c[0], c[1]))
Buggy python submission (verdict: Runtime Error):
x = input()
yyyy, mm, dd = x.split("/")
if mm <= 4:
  print("Heisei")
else:
  print("TBD")
exit(0)

Fixed submission:
x = input()
yyyy, mm, dd = x.split("/")
if int(mm) <= 4:
  print("Heisei")
else:
  print("TBD")

Buggy python submission (verdict: Runtime Error):
x = input()
yyyy, mm, dd = x.split("/")
if mm <= 4:
  print("Heisei")
else:
  print("TBD")
  

Fixed submission:
x = input()
yyyy, mm, dd = x.split("/")
if int(mm) <= 4:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
z =0

for i in range(1, n+1, 2):
    b = n//i
    c = n%i
    if b==c:
        a.append(i)
print(sum(a))

Fixed submission:
n = list(map(int, input().split()))
a =[]
c = 1
b = []

for i in range(1, n[0]+1):
    b.append(i)

for j in range(1, n[1]+1):
    a.append(j)

for k in range(b[-1]):
    if b[-1] == a[-1]:
        print(c)
        break
    else:
        a[-1] += 1
        c += 1

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
r = a[0]
g = a[1]
b = a[2]
n = a[3]
c = 0

for i in range(n+1):
    for j in range(n+1):
        k = (n - (r*i + g*j))//b
        if k >= 0:
            if n == r*i + g*j + b*k:
                c += 1
print(c)

Fixed submission:
n = list(map(int, input().split()))
a =[]
c = 1
b = []

for i in range(1, n[0]+1):
    b.append(i)

for j in range(1, n[1]+1):
    a.append(j)

for k in range(b[-1]):
    if b[-1] == a[-1]:
        print(c)
        break
    else:
        a[-1] += 1
        c += 1
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
r = a[0]
g = a[1]
b = a[2]
n = a[3]
c = 0

for i in range(n+1):
    for j in range(n+1):
        k = (n - (r*i + g*j))//b
        if k >= 0:
            if n == r*i + g*j + b*k:
                c += 1
print(c)

Fixed submission:
a = list(map(int, input().split()))
r = a[0]
g = a[1]
b = a[2]
n = a[3]
c = 0

for i in range(n+1):
    for j in range(n+1):
        k = (n - (r*i + g*j))//b
        if k >= 0:
            if n == r*i + g*j + b*k:
                c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
r = a[0]
g = a[1]
b = a[2]
n = a[3]
c = 0

for i in range(n+1):
    for j in range(n+1):
        for k in range(n+1):
            if n == r*i + g*j + b*k:
                c += 1
print(c)

Fixed submission:
a = list(map(int, input().split()))
r = a[0]
g = a[1]
b = a[2]
n = a[3]
c = 0

for i in range(n+1):
    for j in range(n+1):
        k = (n - (r*i + g*j))//b
        if k >= 0:
            if n == r*i + g*j + b*k:
                c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input.split())

if a > b:
  for i in range(a, b):
    if i == c:
      print('Yes')
      break
  print('No')
else:
  for i in range(b, a):
    if i == c:
      print('Yes')
      break
  print('No')

Fixed submission:
import sys
a, b, c = map(int, input().split())
 
if a > b:
  for i in range(b, a):
    if i == c:
      print('Yes')
      sys.exit(0)
else:
  for i in range(a, b):
    if i == c:
      print('Yes')
      sys.exit(0)

print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split)
if a < c < b:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
a, b, c = map(int, input().split())
 
if a > b:
  for i in range(b, a):
    if i == c:
      print('Yes')
      sys.exit(0)
else:
  for i in range(a, b):
    if i == c:
      print('Yes')
      sys.exit(0)

print('No')
Buggy python submission (verdict: Runtime Error):
x = int(input())
s = input()
i = int(input())

si = s[i]

s = s.replace('si', '*')
print(s)

Fixed submission:
_  = input()
s = input()
index = int(input())-1

result = ''

t = s[index]

for i in s:
  if i != t:
    result += '*'
  else:
    result += i
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
print(N-K+1)

Fixed submission:
N,K = map(int,input().split())
print(N-K+1)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Fixed submission:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(2)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

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

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = []
sum_profit = 0

for i in N:
    profit[i] = data[0][i] - data[1][i]
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Fixed submission:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(2)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

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

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(N)]

profit = []
sum_profit = 0

for i in N:
    profit[i] = data[1][i] - data[2][i]
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

Fixed submission:
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(2)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])

# cm = np.prod(A)
# max_gcd = 0
# for i in range(len(A)):
#     Am = A.copy()
#     Am[i] = cm
#     gcd = np.gcd.reduce(Am)
#     if gcd > max_gcd:
#         max_gcd = gcd
print(sum(A))

Fixed submission:
A, B, T = [int(i) for i in input().split()]
b = ((T+0.5) // A) * B
print(int(b))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.array([int(i) for i in input().split()])

cm = np.prod(A)
max_gcd = 0
# for i in range(len(A)):
#     Am = A.copy()
#     Am[i] = cm
#     gcd = np.gcd.reduce(Am)
#     if gcd > max_gcd:
#         max_gcd = gcd
print(max_gcd)

Fixed submission:
A, B, T = [int(i) for i in input().split()]
b = ((T+0.5) // A) * B
print(int(b))
Buggy python submission (verdict: Runtime Error):
N, Q  = [int(a) for a in input().split()]
s = input()
s_dict = {c:[] for c in set('ABCDEFGHIJKLMNOPQRSTUVWXYZ')}
for i, c in enumerate(s):
    s_dict[c].append(i+1)
g = [1] * (N+2)

for _ in range(Q):
    row = input()
    c, lr = row.split()
    for i in s_dict[c]:
        mover = g[i]
        g[i] -= mover
        if lr == 'L':
            g[i-1] += mover
        else:
            g[i+1] += mover

print(sum(g[1:-1]))

Fixed submission:
A, B, C  = [int(a) for a in input().split()]
if A == B == C:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
def get_div(num):
    if num == 1:
        return [1]
    else:
        return [i for i in range(1,num) if num%i==0]

A, B, K  = [int(a) for a in input().split()]
cat = get_div(A) + get_div(B)
dup = [x for x in set(cat) if cat.count(x) > 1]
dup = sorted(dup)
print(dup[K-1])

Fixed submission:
def get_div(num):
    if num == 1:
        return [1]
    else:
        return [i for i in range(1,num+1) if num%i==0]

A, B, K  = [int(a) for a in input().split()]
cat = get_div(A) + get_div(B)
dup = sorted([x for x in set(cat) if cat.count(x) > 1])
dup.reverse()
print(dup[K-1])

Buggy python submission (verdict: Runtime Error):
def get_div(num):
    if num == 1:
        return [1]
    else:
        return [i for i in range(1,num) if num%i==0]

A, B, K  = [int(a) for a in input().split()]
cat = get_div(A) + get_div(B)
dup = [x for x in set(cat) if cat.count(x) > 1]
dup = sorted(dup)
print(dup[K-1])

Fixed submission:
def get_div(num):
    if num == 1:
        return [1]
    else:
        return [i for i in range(1,num+1) if num%i==0]

A, B, K  = [int(a) for a in input().split()]
cat = get_div(A) + get_div(B)
dup = sorted([x for x in set(cat) if cat.count(x) > 1])
dup.reverse()
print(dup[K-1])
Buggy python submission (verdict: Time Limit Exceeded):
data = input()
score = 0
size = len(data)

def get_score(data):
    global score
    for i in range(0, size-1):
        ab = data[i:i+2]

        if ab == '10' or ab =='01':
            score += 2
            data = data[:i] + data[i+2:]
            break

    if data == '' or set(data) == {'1'} or set(data) == {'0'}:
        return
    get_score(data)

get_score(data)
print(score)

Fixed submission:
data=input()
n1 = data.count('1')
n0 = data.count('0')
print(min(n1, n0) * 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
x = [int(i) for i in input().split()]

ans = 0
for xi in x:
    if xi < K/2:
        ans += xi*2
    else:
        ans += (K-xi)*2
print(ans)

Fixed submission:
N = int(input())
A = int(input())
print(N**2 - A)

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

ans = 0
if K == 1:
    print(2*N)
else:
    for xi in x:
        if xi < K//2:
            ans += xi*2
        else:
            ans += (K-xi)*2
    print(ans)  

Fixed submission:
N = int(input())
A = int(input())
print(N**2 - A)

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

ans = 0
for xi in x:
    if xi < K//2:
        ans += xi*2
    else:
        ans += (K-xi)*2
print(ans)  

Fixed submission:
N = int(input())
A = int(input())
print(N**2 - A)
Buggy python submission (verdict: Runtime Error):
N = 
K = 
print(N-K+1)

Fixed submission:
N,K = map(int,input().split())
print(N - K + 1)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

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

odd_list = []
even_list = []

for i in range(N):
    
    if Num_list[i] % 2 == 0:
        even_list.append(Num_list[i])
        
    else:
        odd_list.append(Num_list[i])
        
even_max = max(even_list)
even_min = min(even_list)
odd_max = max(odd_list)
odd_min = min(odd_list)

if len(even_list) < 2:
    even_max = 1
    
elif len(odd_list) < 2:
    odd_max = 1

frac_1 = gcd(even_max,even_min)
frac_2 = gcd(odd_max, odd_min)
frac_3 = gcd(even_max, odd_min)
frac_4 = gcd(odd_max, even_min)

max_frac = max([frac_1, frac_2, frac_3, frac_4])

print(max_frac)

Fixed submission:
from fractions import gcd

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

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(gcd(gcd_l[i], A[i]))
    gcd_r.append(gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))