Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = input()
a = list(map(int,input().split()))
re = reduce((lambda x, y: x * y), a)
if re <= 1000000000000000000:
    print(re)
else:
    print("-1")


Fixed submission:
# import numpy 
n = int(input())
a = list(map(int,input().split()))
re = 1
if 0 in a:
    print("0")
else:
    for i in a :
        re = re * i
        if re > 1000000000000000000:
            print("-1")
            quit()
    print(re)

Buggy python submission (verdict: Time Limit Exceeded):
# import math
n = input()
a = list(map(int,input().split()))
re = 1
for i in a :
    re = re * i
if re <= 1000000000000000000:
    print(re)
else:
    print("-1")


Fixed submission:
# import numpy 
n = int(input())
a = list(map(int,input().split()))
re = 1
if 0 in a:
    print("0")
else:
    for i in a :
        re = re * i
        if re > 1000000000000000000:
            print("-1")
            quit()
    print(re)
Buggy python submission (verdict: Runtime Error):
    t=input()
    print(t.replace("?","D"))

Fixed submission:
t = input()
print(t.replace('?', 'D'))
Buggy python submission (verdict: Runtime Error):

n,m = map(int.input().split())
if n < 10:
    print(m+(100*(10-n)))
else:
   print(m)

Fixed submission:
n,m = map(int,input().split())
if n < 10:
    print(m+(100*(10-n)))
else:
   print(m)
Buggy python submission (verdict: Runtime Error):

get = input()
for i in range(len(get)):
    print("x".end="")


Fixed submission:

get = input()
print(''.join('x' for i in range(len(get))))
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a==1
 print(0);
else
 print(1);

Fixed submission:
a = int(input())
if a==1:
 print(0)
else:
 print(1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

result= 0

for j in range(0,n):
  result += a[j]*sum(a[j+1:n])

print(result%(10**9+7))

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

result= 0
asum = sum(a)
for j in range(0,n):
  asum -= a[j]
  result += a[j]*(asum)

print(result%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
sumlist = []
for i in range(1,n):
  sumlist.append(sum(a[i:n]))

result= 0

for j in range(0,len(sumlist)):
  result += a[j]*sumlist[j]

print(result%(10**9+7))

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

result= 0
asum = sum(a)
for j in range(0,n):
  asum -= a[j]
  result += a[j]*(asum)

print(result%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
sum = 0

for i in range(0,n-1):
	for j in range(i+1,n):
  		sum += a[i]*a[j]
    
print(sum%(10**9+7))
	

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

result= 0
asum = sum(a)
for j in range(0,n):
  asum -= a[j]
  result += a[j]*(asum)

print(result%(10**9+7))
Buggy python submission (verdict: Runtime Error):
inputstr1 = input().split()
n = inputstr1[0]
k = inputstr1[1]
s = input()

chars = list(s)
chars[int(k)-1]=chars[int(k)-1].lower()
correct = "".join(chars)
print(correct)

Fixed submission:
a, b, t = map(int,input().split())
i = 1
bisket = 0

while t+0.5 > i*a:
    bisket += b
    i += 1

print(bisket)
Buggy python submission (verdict: Runtime Error):
s = input()
x, count0, count1 = 0
for i in s:
    count0 = count0+1 if i==str(x) else count0
    x = int(not(x))
x = 1
for i in s:
    count1 = count1 + 1 if i == str(x) else count1
    x = int(not(x))
print(min(count0, count1))

Fixed submission:
s = input()

x = 0
count0 = 0
count1 = 0

for i in s:
    if i == str(x):
        count0 += 1
    x = int(not(x))

x = 1
for i in s:
    if i == str(x):
        count1 += 1
    x = int(not(x))
#print("count0:" + str(count0))
#print("count1:" + str(count1))
print(min(count0, count1))
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, M, C = [int(x) for x in input().split()]
B = np.array([int(x) for x in input().split()])
A = np.empty((N,M))

count = 0
for n in range(N):
    A[n] = [int(m) for m in input().split()]
    count += (sum(A[n] * B)+C > 0)
print(count)


Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(str(H * W - (h * W + w * H - h * w)))
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
lista = [a for a in range(1, A + 1) if A % a == 0]
listb = [b for b in range(1, B + 1) if B % b == 0]
listc = list(set(lista) & set(listb))
#print(lista)
#print(listb)
#print(listc)

print(listc[K])


Fixed submission:
A, B, K = map(int, input().split())
lista = [a for a in range(1, A + 1) if A % a == 0]
listb = [b for b in range(1, B + 1) if B % b == 0]
listc = sorted(list(set(lista) & set(listb)))
#print(lista)
#print(listb)
#print(listc)

print(listc[-K])
Buggy python submission (verdict: Time Limit Exceeded):
s = input()

count = 0
while True:
    s0 = s
    if s.count("10") != 0:
        count += 2 * s.count("10")
        s = s.replace("10","")
        #print(s)
    elif s.count("01") != 0:
        count += 2 * s.count("01")
        s = s.replace("01","")
        #print(s)
    if s0 == s:
        break

#print(s)
print(count)


"""
s = input()

count = 0
while True:
    s0 = s
    s = s.replace("10","",1)
    if s0 != s:
        count += 2
        #print(s)
    else:
        s1 = s
        s = s.replace("01","",1)
        if s1 != s:
            count += 2
            #print(s)
        else:
            break

#print(s)
print(count)
"""

Fixed submission:
s = input()

s0 = s.count("0")
s1 = s.count("1")
#print(s0)
#print(s1)
print(len(s)-(max(s0,s1)-min(s0,s1)))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()

count = 0
while True:
    s0 = s
    s = s.replace("10","",1)
    if s0 != s:
        count += 2
        #print(s)
    else:
        s1 = s
        s = s.replace("01","",1)
        if s1 != s:
            count += 2
            #print(s)
        else:
            break

#print(s)
print(count)


Fixed submission:
s = input()

s0 = s.count("0")
s1 = s.count("1")
#print(s0)
#print(s1)
print(len(s)-(max(s0,s1)-min(s0,s1)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    if i == 0:
        ans += A[i]
    else:
        ans *= A[i]
        if ans > 10**18:
            ans *= -1
        if A[i] == 0:
            ans = 0
            break

if ans < 0:
    ans = -1
print(ans)

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

if 0 in A:
    print(0)
else:
    ans = A[0]
    for i in range(N-1):
        ans *= A[i+1]
        if ans > 10**18:
            ans = -1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input())

if S[K] == "A":
    S[K] = "a"
elif S[K] == "B":
    S[K] = "b"
else:
    S[K] = "c"

for i in range(N):
    print(S[i], end="")

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

if S[K-1] == "A":
    S[K-1] = "a"
elif S[K-1] == "B":
    S[K-1] = "b"
else:
    S[K-1] = "c"

for i in range(N):
    print(S[i], end="")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
ans = 0;
for i in range(2):
  if A > B:
    ans += A
    A -= 1
  else:
    ans += B:
    B -= 1
else:
  print(ans)

Fixed submission:
A, B = map(int, input().split())
ans = 0
for i in range(2):
  if A > B:
    ans += A
    A -= 1
  else:
    ans += B
    B -= 1
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
h = []
for i in range(N):
    h.append(int(input()))
else:
    h.sort()

hi = []
i = 0
while i + (K - 1) < N:
    hi.append(int(h[i + 2] - h[i]))
    i += 1

print(min(hi))


Fixed submission:
N, K = list(map(int, input().split()))
h = []
for i in range(N):
    h.append(int(input()))
else:
    h.sort()

hi = []
i = 0
while i + (K - 1) < N:
    hi.append(int(h[i + (K - 1)] - h[i]))
    i += 1

print(min(hi))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans = 0

for i in range(1, N+1):
    tmp = i
    while(tmp <= N):
        ans += tmp
        tmp += i

print(ans)

Fixed submission:
N=int(input())
ans = 0
 
for i in range(1, N+1):
    num = N // i
    if num == 1:
        ans += i
    else:
        ans += num * (i + num * i) / 2
 
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num

N = int(input())
ans = 0

for i in range(1,N+1):
    ans += i * search_divisor_num_1(i)

print(ans)

Fixed submission:
N=int(input())
ans = 0
 
for i in range(1, N+1):
    num = N // i
    if num == 1:
        ans += i
    else:
        ans += num * (i + num * i) / 2
 
print(int(ans))

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

N = int(input())
ans = 0

for i in range(1,N+1):
    ans += i * sympy.divisor_count(i)

print(ans)

Fixed submission:
N=int(input())
ans = 0
 
for i in range(1, N+1):
    num = N // i
    if num == 1:
        ans += i
    else:
        ans += num * (i + num * i) / 2
 
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int,input().split())) for _ in range(Q)]
max_A = max(A)

# Aの値について数列を作る
A_num = [A.count(i) for i in range(10 ** 5 + 1)]
Si = sum(A)

for BC in BCs:
    # BC[0] ...　置換前の値
    # BC[1] ...　置換後の値
    
    if A_num[BC[0]] > 0: 
        Si += A_num[BC[0]] * (BC[1] -BC[0])
        A_num[BC[1]] += A_num[BC[0]]
        A_num[BC[0]] = 0

    print(Si)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int,input().split())) for _ in range(Q)]
max_A = max(A)

# Aの値について数列を作る
# A_num = [A.count(i) for i in range(10 ** 5 + 1)]

A_num = [0 for i in range(10 ** 5 + 1)]
for a in A:
    A_num[a] += 1

Si = sum(A)

for BC in BCs:
    # BC[0] ...　置換前の値
    # BC[1] ...　置換後の値
    
    if A_num[BC[0]] > 0: 
        Si += A_num[BC[0]] * (BC[1] -BC[0])
        A_num[BC[1]] += A_num[BC[0]]
        A_num[BC[0]] = 0

    print(Si)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int,input().split())) for _ in range(Q)]
max_A = max(A)

# Aの値について数列を作る
A_num = [A.count(i) for i in range(10 ** 5 + 1)]
Si = sum(A)

for BC in BCs:
    # BC[0] ...　置換前の値
    # BC[1] ...　置換後の値
    
    if A_num[BC[0]] > 0: 
        Si += A_num[BC[0]] * (BC[1] -BC[0])
        A_num[BC[1]] += A_num[BC[0]]
        A_num[BC[0]] = 0

    print(Si)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BCs = [list(map(int,input().split())) for _ in range(Q)]
max_A = max(A)

# Aの値について数列を作る
# A_num = [A.count(i) for i in range(10 ** 5 + 1)]

A_num = [0 for i in range(10 ** 5 + 1)]
for a in A:
    A_num[a] += 1

Si = sum(A)

for BC in BCs:
    # BC[0] ...　置換前の値
    # BC[1] ...　置換後の値
    
    if A_num[BC[0]] > 0: 
        Si += A_num[BC[0]] * (BC[1] -BC[0])
        A_num[BC[1]] += A_num[BC[0]]
        A_num[BC[0]] = 0

    print(Si)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
memory = []
counter = 0

for i in range(N):
    tmp = input()
    if tmp not in memory:
        counter += 1
        memory.append(tmp)

print(counter)

Fixed submission:
import collections

N = int(input())
memory = []
counter = 0

for i in range(N):
    tmp = input()
    memory.append(tmp)

c = collections.Counter(memory)

print(len(c))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N+1):
    j = A.index(i)
    print(j+1,end="")
    if i < N:
        print(" ",end="")

print()

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Z = [-1 for i in range(N)]

for j,v in enumerate(A):
    Z[v-1] = j+1

for k,v in enumerate(Z):
    print(v,end="")
    if k < N:
        print(" ",end="")
    else:
        print()
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a)

Fixed submission:
S = input()
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
L,R = map(int,input().split())
right = min(L+2019, R+1)
minumum = 2019

for i in range(L,right):
    for j in range(i+1,right):
         minimum = min(minimum,(i*j) % 2019)

print(minimum)

Fixed submission:
L,R = map(int,input().split())
right = min(L+2019, R+1)
minimum = 2019

for i in range(L,right):
    for j in range(i+1,right):
         minimum = min(minimum,(i*j) % 2019)

print(minimum)

Buggy python submission (verdict: Time Limit Exceeded):
L,R = map(int,input().split())
minmod = 2019

for i in range(L,R,1):
    for j in range(i+1,R+1,1):
        minmod = min(minmod,i*j%2019)

print(minmod)

Fixed submission:
L,R = map(int,input().split())
right = min(L+2019, R+1)
minimum = 2019

for i in range(L,right):
    for j in range(i+1,right):
         minimum = min(minimum,(i*j) % 2019)

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

A,B,C,D = map(int,input().split())
count = 0

QC = 0 #Cで割り切れる
QD = 0 #Dで割り切れる
QCD = 0 #CとDで割り切れる

CD = int(C * D / math.gcd(C, D)) #最大公約数
print(CD)

#約数の個数を求める
QC = (B // C) - (A // C)
if A % C == 0:
        QC += 1

QD = (B // D) - (A // D)
if A % D == 0:
        QD += 1

QCD = (B // CD) - (A // CD)
if A % CD == 0:
        QCD += 1

N = B-A+1
CorD = QC+QD-QCD

print(N-CorD)

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

def lcm(a, b):
    return a * b // gcd (a, b)

A,B,C,D = map(int,input().split())
count = 0

QC = 0 #Cで割り切れる
QD = 0 #Dで割り切れる
QCD = 0 #CとDで割り切れる

CD = lcm(C,D) #最大公約数

#約数の個数を求める
QC = (B // C) - (A // C)
if A % C == 0:
        QC += 1

QD = (B // D) - (A // D)
if A % D == 0:
        QD += 1

QCD = (B // CD) - (A // CD)
if A % CD == 0:
        QCD += 1

N = B-A+1
CorD = QC+QD-QCD

print(N-CorD)
Buggy python submission (verdict: Time Limit Exceeded):
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

AB = []
ABC = []

for i in A:
    for j in B:
        AB.append(i+j)

AB.sort(reverse=True)
AB_max = AB[:K]

for j in AB_max:
    for h in C:
        ABC.append(j+h)

ABC.sort(reverse=True)

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

Fixed submission:
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

AB = []
ABC = []

for i in A:
    for j in B:
        AB.append(i+j)

AB.sort(reverse=True)
AB_max = AB[:K]

for j in AB_max:
    for h in C:
        ABC.append(j+h)

ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])
Buggy python submission (verdict: Runtime Error):
b = input()

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

Fixed submission:
b = input()
# print(type(b))

if b == "A":
    print("T")
elif b == "C":
    print("G")
elif b == "G":
    print("C")
else:
    print("A")
Buggy python submission (verdict: Runtime Error):
y,m,d = map(int,input().split("/"))

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
    print("TBD")
else:
    print("Heisei")

Fixed submission:
y,m,d = map(int,input().split("/"))

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
        print("TBD")
    else:
        print("Heisei")   
else:
    print("Heisei")

Buggy python submission (verdict: Runtime Error):
y,m,d = map(int,input().split("/")

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
    print("TBD")
else:
    print("Heisei")

Fixed submission:
y,m,d = map(int,input().split("/"))

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
        print("TBD")
    else:
        print("Heisei")   
else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split)
x = A + B if A % B == 0 else B - A
print(x)

Fixed submission:
A,B = map(int,input().split())
x = A + B if B % A == 0 else B - A
print(x)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
max(10 * A + B + C, A + 10*B + C,　A + B + 10 * C)

Fixed submission:
A,B,C = map(int,input().split())
ans = max(10*A + B + C, A+ 10*B + C, A + B + 10*C)
print(ans)

Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split()
max(10*A + B + C,A+10*B+C,A+B+10*C)

Fixed submission:
A,B,C = map(int,input().split())
ans = max(10*A + B + C, A+ 10*B + C, A + B + 10*C)
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
C = [1,2,3]

for i in C:
  if A*B*C % 2 == 1:
    print("Yes")
    exit()
print("No")


Fixed submission:
A,B = map(int,input().split())
C = [1,2,3]

for i in C:
  if (A*B*i) % 2 == 1:
    print("Yes")
    exit()
print("No")
Buggy python submission (verdict: Runtime Error):
import math

def lcm(x,y):
    return (x*y) // math.gcd(x,y)

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

#aの最小公倍数を求める
lcm_t = a[0]

for j in range(1,N):
    lcm_t = lcm(lcm_t,a[j])

lcm_t = max(1,lcm_t-1)

ans = 0

for k in a:
    ans += lcm_t % k

print(ans)

Fixed submission:
import fractions

def lcm(x,y):
    return (x*y) // fractions.gcd(x,y)

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

#aの最小公倍数を求める
lcm_t = a[0]

for j in range(1,N):
    lcm_t = lcm(lcm_t,a[j])

lcm_t = max(1,lcm_t-1)

ans = 0

for k in a:
    ans += lcm_t % k

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 2 != 0:
    n *= 2
print(N)

Fixed submission:
N = int(input())
if N % 2 != 0:
    N *= 2
print(N)
Buggy python submission (verdict: Runtime Error):
S = list(input())
ans = 0
for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 S = list(input())
ans = 0
for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 
print(ans)

Fixed submission:
S = list(input())
ans = 0

for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(str(N))

Sn = 0

for i in T:
    Sn += int(i)

if Sn % M == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
T = list(str(N))

Sn = 0

for i in T:
    Sn += int(i)

if N % Sn == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = list(input())
Sn = 0

for i in N:
    Sn += int(i)

if Sn % N == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
T = list(str(N))

Sn = 0

for i in T:
    Sn += int(i)

if N % Sn == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
ans = []

master = list(range(A,B+1))
sho = master.copy()
ko = master.copy()
L = len(master)

sho.sort()
ko.sort(reverse = True)

for i in range(min(K,L)):
    ans.append(sho[i])

for i in range(min(K,L)):
    ans.append(ko[i])

ans2 = set(ans)
ans3 = list(ans2)
ans3.sort()

print(ans3)


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

if A+K-1 >= B-K+1:
    ans = list(range(A,B+1))
    for i in ans:
        print(i)
else:
    for i in list(range(A,A+K)):
        print(i)
    for i in list(range(B-K+1,B+1)):
        print(i)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
print(min(A,B)+min(C,D))A = int(input())
B = int(input())
C = int(input())
D = int(input())

print(min(A,B)+min(C,D))

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

print(min(A,B)+min(C,D))

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
print(min(A,B)+min(C,D))

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

print(min(A,B)+min(C,D))
Buggy python submission (verdict: Runtime Error):
a = list(input())
b = list(input())
c = list(input())

print(a[0]+b[1]+c[2])

Fixed submission:
A,B = map(int,input().split())
L = list(range(A,B+1))
counter = 0

for i in L:
    #回文判定
    tmp = list(str(i))
    if tmp[0] == tmp[4] and tmp[1] == tmp[3]:
        counter += 1

print(counter)
Buggy python submission (verdict: Runtime Error):
S = list(input())
S[3] = 8
print("".join(S))


Fixed submission:
S = list(input())
S[3] = "8"
a = "".join(S)
print(a)
Buggy python submission (verdict: Runtime Error):
S = input()

N = int(input())
H = list(input())

harshad = 0

for i in H:
    harshad += int(i)

if N % harshad == 0:
    print("Yes")
else:
    print("No")



Fixed submission:
S = input()

N = int(S)
H = list(S)

harshad = 0

for i in H:
    harshad += int(i)

if N % harshad == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
X,Y = map(int,input().split())
if X<Y:
    print("<")
elif X>Y:
    print(">")
else:
    print("=")

Fixed submission:
X,Y = input().split()
X = int("0x"+X,0)
Y = int("0x"+Y,0)

if X<Y:
    print("<")
elif X>Y:
    print(">")
else:
    print("=")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []

for i in range(N):
    tmp = int(input())
    if tmp not in A:
        A.append(tmp)
    else:
        A.remove(tmp)

print(len(A))

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

N = int(input())

for i in range(N):
    tmp = input()
    d[tmp] += 1

counter = 0

for j,v in d.items():
    if v % 2 == 1:
        counter += 1

print(counter)
Buggy python submission (verdict: Runtime Error):
X,T = map(int,input().split())
print(max(0,X-t))

Fixed submission:
X,T = map(int,input().split())
print(max(0,X-T))
Buggy python submission (verdict: Runtime Error):
n = input( )
result = sum(list(map(int, str(n))))

if result % 9 == 0 :
    print('Yes')
else :
    print('No')


Fixed submission:
N, X, T = map(int, input().split())
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) // int(X) ) * int(T) )

Buggy python submission (verdict: Runtime Error):
N, X, T = int( input().split() )
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) // int(X) ) * int(T) )


Fixed submission:
N, X, T = map(int, input().split())
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) // int(X) ) * int(T) )

Buggy python submission (verdict: Runtime Error):
N, X, T = map(int, input().split())
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) / int(X) * int(T) )


Fixed submission:
N, X, T = map(int, input().split())
if int(N) % int(X) != 0 :
	print( ( int(N) // int(X) + 1) * int(T) )
if int(N) % int(X) == 0 :
	print( (int(N) // int(X) ) * int(T) )
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))

min_value=100

for i in a:
    x = 0
    while i % 2 == 0:
        i //= 2
        x += 1
    if min_value > x:
        min_value = x
print(min_value)

Fixed submission:
s = input()
if 'RRR' in s :
    print('3')
elif 'RR' in s :
    print('2')
elif 'R' in s :
    print('1')
else :
    print('0')