Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()

ame = 0
if S[0] =="R":
    ame = 1
    if S[1] == "R":
        ame = 2
        if S[2] == "R":
            ame = 3
else
    if S[1] == "R":
        ame = 1
        if S[2] == "R":
            ame = 2
    elif S[2] == "R":
        ame = 1
print(ame)


Fixed submission:
S = input()

ame = 0
if S[0] =="R":
    ame = 1
    if S[1] == "R":
        ame = 2
        if S[2] == "R":
            ame = 3
else:
    if S[1] == "R":
        ame = 1
        if S[2] == "R":
            ame = 2
    elif S[2] == "R":
        ame = 1
print(ame)
Buggy python submission (verdict: Runtime Error):
x = [int(input()) for i in range(5)]

for i in range(5):
    if x[i]==0:
        print(i)

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

for i in range(5):
    if x[i]==0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
A,B = int(input().split())

print(A*B)

Fixed submission:
A,B = (int(x) for x in input().split())

print(A*B)
Buggy python submission (verdict: Runtime Error):
st = input()
if(st.is_lower()):
  print('A')
else:
  print('B')

Fixed submission:
st = input()
if(st.islower()):
  print('a')
else:
  print('A')
Buggy python submission (verdict: Time Limit Exceeded):
def recur(ba,bb):
    if(ba <= 0 and bb <= 0):
        return 0
    if(ba <= 0):
        #only b twice
        return (bb*2)-1
    elif(bb<=0):
        return (ba*2)-1
    else:
        tb = max(bb+bb-1,recur(ba,bb-2))
        ta = max(ba+ba-1,recur(ba-2,bb))
        bt = max(ba+bb,recur(ba-1,bb-2))
        return max(max(tb,ta),bt)

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

print(recur(a,b))


Fixed submission:
def recur(ba,bb):
    tb = (2*bb)-1
    ta = (2*ba)-1
    bt = ba+bb
    return max(max(tb,ta),bt)

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

print(recur(a,b))

Buggy python submission (verdict: Time Limit Exceeded):
def recur(ba,bb):
    if(ba <= 0 and bb <= 0):
        return 0
    if(ba <= 0):
        #only b twice
        return max(bb+(bb-1),recur(0,max(0,bb-2)))
    elif(bb<=0):
        return max(ba+(ba-1),recur(max(0,ba-2),0))
    else:
        tb = max(bb+bb-1,recur(ba,bb-2))
        ta = max(ba+ba-1,recur(ba-2,bb))
        bt = max(ba+bb,recur(ba-1,bb-2))
        return max(max(tb,ta),bt)

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

print(recur(a,b))


Fixed submission:
def recur(ba,bb):
    tb = (2*bb)-1
    ta = (2*ba)-1
    bt = ba+bb
    return max(max(tb,ta),bt)

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

print(recur(a,b))
Buggy python submission (verdict: Runtime Error):
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = input()
print(arr[k])

Fixed submission:
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(arr[k-1])
Buggy python submission (verdict: Runtime Error):
a,b = [int(e) for e in input().split()]
print(a*b)2 5

Fixed submission:
a,b = [int(e) for e in input().split()]
print(a*b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(e) for e in input().split()]
ans = 1
if 0 in a:
    print(0)
else:
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        break  
else:
    print(ans)

Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
ans = 1
if 0 in a:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
            break  
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(e) for e in input().split()]
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print(-1)   
else:
    print(ans)

Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
ans = 1
if 0 in a:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
            break  
    else:
        print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(e) for e in input().split()]
flag = False
for i in range(0,n):
    for j in range(0,n):
        if i != j and a[i] == a[j]:
            flag = True
            break
if flag:
    print('NO')
else:
    print('YES')


Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
a.sort()
flag = False
for i in range(0,n-1):
    if a[i] == a[i+1]:
        flag = True

if flag:
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = [int(i) for i in input().split()]
res = 0

for i in range(0,n):
    flag = True
    for j in range(0,i):
        if p[i] > p[j]:
            flag = False
    if flag:
        res += 1
print(res)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
res = 1
min = p[0]
for i in range(1,n):
    if p[i] < min:
        res += 1
        min = p[i]
 
print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
t = input()
a=''
for i in range(0,2*n):
    if i % 2 == 0:
        a += s[i//2]
    else:
        a += t[i//2]
print(a)

Fixed submission:
n = int(input())
s,t = [i for i in input().split()]
a=''
for i in range(0,2*n):
    if i % 2 == 0:
        a += s[i//2]
    else:
        a += t[i//2]
print(a)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
t = input()
a=''
for i in range(0,2*n):
    if i % 2 == 0:
        a += s[i//2]
    else:
        a += t[i//2]
print(a)

Fixed submission:
n = int(input())
s,t = [i for i in input().split()]
a=''
for i in range(0,2*n):
    if i % 2 == 0:
        a += s[i//2]
    else:
        a += t[i//2]
print(a)
Buggy python submission (verdict: Runtime Error):
import math
a,b = (int(i) for i in input().split())
print(int((a*b)/math.gcd(a,b)))

Fixed submission:
import fractions
a,b = (int(i) for i in input().split())
print(int((a*b) /fractions.gcd(a,b)))
Buggy python submission (verdict: Runtime Error):
a = input()
a = int(a)
b = input()
b = int(b)
if a < 10 && b < 10:
  print(a * b)
else:
  print(-1)

Fixed submission:
nums = [int(e) for e in input().split()]
if nums[0] < 10 and nums[1] < 10:
    print(nums[0] * nums[1])
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
i = 9
flag = True
while i >= 1:
    if s % i == 0 and s / i <=9:
        print("Yes")
        flag = False
        break
if flag:
    print("No")

Fixed submission:
s = int(input())
i = 9
flag = True
while i >= 1:
    if s % i == 0 and s / i <=9:
        print("Yes")
        flag = False
        break
    i -= 1
if flag:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
i = 9
flag = True
while i >= 1:
    if s % i == 0 and s / i <=9:
        print("Yes")
        flag = False
        break
if flag:
    print("No")

Fixed submission:
s = int(input())
i = 9
flag = True
while i >= 1:
    if s % i == 0 and s / i <=9:
        print("Yes")
        flag = False
        break
    i -= 1
if flag:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
min = s - 1
i = 1
while i < (s / 2):
    if s % i == 0:
       t = i + (s // i) - 2
       if t < min:
           min = t
    i += 1
print(min)


Fixed submission:
s = int(input())
min = s - 1
sqr = s ** 0.5
i = int(sqr)
while i >= 1:
    if s % i == 0:
       t = i + (s // i) - 2
       break
    i -= 1
print(t)

Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
min = s - 1
i = 1
while i < s:
    if s % i == 0:
       t = i + (s // i) - 2
       if t < min:
           min = t
    i += 1
print(min)


Fixed submission:
s = int(input())
min = s - 1
sqr = s ** 0.5
i = int(sqr)
while i >= 1:
    if s % i == 0:
       t = i + (s // i) - 2
       break
    i -= 1
print(t)
Buggy python submission (verdict: Runtime Error):
n = input()
print((n // 2 + 1)/n))

Fixed submission:
n = int(input())
print((n // 2 + (n % 2))/n)

Buggy python submission (verdict: Runtime Error):
n = input()
print((n // 2 + 1)/n)

Fixed submission:
n = int(input())
print((n // 2 + (n % 2))/n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(e) for e in input().split()]
b = [0] * n
for i in range(0,n):
    b[a[i]] = i + 1
for j in range(0,n):
    print(b[j], end = " ")

Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
b = [0] * n
for i in range(0,n):
    b[a[i] - 1] = i + 1
for j in range(0,n):
    print(b[j], end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(e) for e in input().split()]
b = []
for i in range(0,n):
    b[a[i]] = i + 1
for j in range(0,n):
    print(b[j], end = " ")

Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
b = [0] * n
for i in range(0,n):
    b[a[i] - 1] = i + 1
for j in range(0,n):
    print(b[j], end = " ")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(e) for e in input().split()]
for i in range(0,n):
    for j in range(0,n):
        if a[j] == i + 1:
            print(j + 1, end = " ")


Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
b = [0] * n
for i in range(0,n):
    b[a[i] - 1] = i + 1
for j in range(0,n):
    print(b[j], end = " ")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(e) for e in input().split()]
for i in range(0,n):
    for j in range(0,n):
        if l[j] == i:
            print(j, end = " ")
            break


Fixed submission:
n = int(input())
a = [int(e) for e in input().split()]
b = [0] * n
for i in range(0,n):
    b[a[i] - 1] = i + 1
for j in range(0,n):
    print(b[j], end = " ")
Buggy python submission (verdict: Runtime Error):
import math

price = input()
payment = math.ceil(float(price) / 1000) * 1000
result = payment - price
print(int(result))

Fixed submission:
import math

price = int(input())
payment = math.ceil(float(price) / 1000) * 1000
result = payment - price
print(int(result))
Buggy python submission (verdict: Runtime Error):
S = input()

if S.count("R") == 2 and S[1] != R:
  print(1)
  
else:
  print(S.count("R"))

Fixed submission:
S = input()
 
if S.count("R") == 2 and S[1] != "R":
  print(1)
  
else:
  print(S.count("R"))

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

if ("RRR" in S) == true:
  print(3)
elif("RR" in S) == true:
  print(2)
elif("R" in S) == true:
  print(1)
else:
  print(0)



Fixed submission:
S = input()
 
if S.count("R") == 2 and S[1] != "R":
  print(1)
  
else:
  print(S.count("R"))
Buggy python submission (verdict: Runtime Error):
N = input()
 
if N.isupper() == true:
  print("A")
else:
  print("a")

Fixed submission:
if input().isupper():
  print('A')
else:
  print('a')

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

if n.isupper() == true:
  print("A")
else:
  print("a")

Fixed submission:
if input().isupper():
  print('A')
else:
  print('a')
Buggy python submission (verdict: Runtime Error):
R = map(int,input())
print(2*R*3.14)


Fixed submission:
R = int(input())
print(2*R*3.14)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
sub = list(map(int,input().split())) 
number = list(range(1, N+1))
cnt = 0 
t = len(sub)
for i in range(N):
    for j in range(t):
        if number[i] == sub[j]:
            cnt = cnt + 1
        
    print(cnt)
    cnt = 0



Fixed submission:
N = int(input())
sub = list(map(int, input().split()))
ans = [0]*(N)
for i in sub:
    ans[i-1] += 1
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
sub = list(map(int,input().split())) 
number = list(range(1, N+1, 1)) 
cnt = 0 
for i in range(N):
    for j in range(int(len(sub))):
        if number[i] == sub[j]:
            cnt = cnt + 1
        
    print(cnt)
    cnt = 0

Fixed submission:
N = int(input())
sub = list(map(int, input().split()))
ans = [0]*(N)
for i in sub:
    ans[i-1] += 1
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
sub = list(map(int,input().split())) 
number = list(range(1, N+1, 1)) 
cnt = 0 
for i in range(int(len(number))):
    for j in range(int(len(sub))):
        if number[i] == sub[j]:
            cnt = cnt + 1
        
    print(cnt)
    cnt = 0

Fixed submission:
N = int(input())
sub = list(map(int, input().split()))
ans = [0]*(N)
for i in sub:
    ans[i-1] += 1
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
line = input().rstrip().split(" ")
N = [str(n) for n in line]
X = N[0]
Y = N[1]
Z = N[2]
tmp = 0

tmp = X
X = Y
Y = tmp

tmp = X
X = Z
Z = tmp

print(*X,*Y,*Z)

Fixed submission:
line = input().rstrip().split(" ")
N = [str(n) for n in line]
X = N[0]
Y = N[1]
Z = N[2]
tmp = 0

tmp = X
X = Y
Y = tmp

tmp = X
X = Z
Z = tmp

print(X,Y,Z)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
vote = list(map(int,input().split()))

votes = sum(vote)
ans = [i for i in L if i * 4 * M >= votes]

if len(ans) >= M:
    print('Yes')
    
else:
    print('No')

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

votes = sum(vote)
ans = [i for i in vote if i * 4 * M >= votes]

if len(ans) >= M:
    print('Yes')
    
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input().split()
x = 0

for N in S:
  if S[N] == "I":
    x += 1
  elif S[N] == "D":
    x -= 1
print(x)

Fixed submission:
N = int(input())
S = input()
x = 0
ans = 0
 
for i in S:
  if i == "I":
    x += 1
  elif i == "D":
    x -= 1
  ans = max(ans,x)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
from math import ceil
n, x, t = map(int, input().split())
print(t*ceil(n/x))

Fixed submission:
n = str(input())
lst = [int(i) for i in n]
if sum(lst) % 9 ==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
y = []
for x in range(n):
    y.append(input())
print(len(set(y)))

Fixed submission:
S, W = map(int, input().split())
print('unsafe' if W >= S else 'safe')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
item = []
for x in range(n):
    item.append(input())
    x = set(item)
    y = list(x)
print(len(y))    


Fixed submission:
N = int(input())
ls = []
for x in range(N):
    ls.append(input())
print(len(set(ls)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N + 1):
    print(A.count(i))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
li = []
for i in range(n):
    li.append(0)
for x in a:
    li[x-1] += 1
for s in li:
    print(s)
Buggy python submission (verdict: Runtime Error):
K, N = input().split()
A = list(map(int, input().split()))
if 0 in A:
    A.remove(0)
x = max(A) - min(A)
print(x)


Fixed submission:
S = str(input())
if len(S) == 6:
    if S[2] == S[3] and S[4] == S[5]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split()))
if 0 in A:
    A.remove(0)
x = max(A) - min(A)
print(x)


Fixed submission:
S = str(input())
if len(S) == 6:
    if S[2] == S[3] and S[4] == S[5]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
K, N = map(int, input().split())
A = list(map(int, input().split()))
if 2  <= K <= 10 ** 6 and 2 <= N <= 2 * 10 ** 5:
    if 0 in A:
        A.remove(0)
    x = max(A) - min(A)
    print(x)

Fixed submission:
S = str(input())
if len(S) == 6:
    if S[2] == S[3] and S[4] == S[5]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
if n == 1:
    ans = 0
else:
    ans = math.factorial(n) / math.factorial(n - 2) / 2
if m == 1:
        ans += 0
else:
    ans += math.factorial(m) / math.factorial(m - 2) / 2
print(int(ans))

Fixed submission:
import math

n, m = map(int, input().split())
if n <= 1:
    ans = 0
else:
    ans = math.factorial(n) / math.factorial(n - 2) / 2
if m <= 1:
        ans += 0
else:
    ans += math.factorial(m) / math.factorial(m - 2) / 2
print(int(ans))

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

n, m = map(int, input().split())
ans = math.factorial(n) / math.factorial(n - 2) / 2
ans += math.factorial(m) / math.factorial(m - 2) / 2
print(int(ans))

Fixed submission:
import math

n, m = map(int, input().split())
if n <= 1:
    ans = 0
else:
    ans = math.factorial(n) / math.factorial(n - 2) / 2
if m <= 1:
        ans += 0
else:
    ans += math.factorial(m) / math.factorial(m - 2) / 2
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
li = list(S)
ans = 0
found = 1
while found != 0:
    found = 0
    for i in range(len(li)-1):
        if li[i] != li[i+1]:
            del li[i+1]
            del li[i]
            ans += 2
            found = 1
            break
print(ans)



Fixed submission:
S = input()
no1 = S.count('1')
no0 = S.count('0')
print(len(S) - abs(no1 - no0))
Buggy python submission (verdict: Runtime Error):
S = input()
length = len(S)
for c in S:
    if c == 'B':
        countB += 1
soko = 1
ans = 0
for i in range(length):
    if S[-i-1] == 'B':
        ans += i + 1  - soko
        soko += 1
print(ans)

Fixed submission:
S = input()
length = len(S)
countB = 0
for c in S:
    if c == 'B':
        countB += 1
soko = 1
ans = 0
for i in range(length):
    if S[-i-1] == 'B':
        ans += i + 1  - soko
        soko += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
trees = [int(input()) for i in range(N)]
trees.sort()
ans = 10 ** 10
for i in range(N - K + 1):
    ans = min(ans, abs(trees[i]-trees[i+K-1]))
print(ans)

Fixed submission:
D = int(input())
sa = 25 - D
ans = "Christmas"
for _ in range(sa):
    ans += " Eve"
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
trees = [int(input()) for i in range(N)]
trees.sort()
ans = 10 ** 10
for i in range(N - K + 1):
    ans = min(ans, abs(trees[i]-trees[N-K+i]))
print(ans)

Fixed submission:
N, K = map(int, input().split())
trees = [int(input()) for i in range(N)]
trees.sort()
ans = 10 ** 10
for i in range(N - K + 1):
    ans = min(ans, abs(trees[i]-trees[i+K-1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
AllList = list(map(int, input().split()))
OddList = [0 for i in range(100001)]
EvenList = [0 for i in range(100001)]
for i in range(n):
    if i % 2 == 0:
        OddList[AllList[i]] += 1
    else:
        EvenList[AllList[i]] += 1

OddMax = max(OddList)
EvenMax = max(EvenList)
OddMaxNum = OddList.index(OddMax)
EvenMaxNum = EvenList.index(EvenMax)

if OddMaxNum == EvenMaxNum:
    if OddMax > EvenMax:
        EvenList[EvenMaxNum] = 0
    else:
        OddList[OddMaxNum] = 0

OddMax = max(OddList)
EvenMax = max(EvenList)

ans = n - OddMax - EvenMax

print(ans)



Fixed submission:
instr = input()
ans = ""
for c in instr:
    if c == '1':
        ans += '9'
    elif c == '9':
        ans += '1'
    else:
        ans += c
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
instr = intput()
K = int(instr)

COdd = math.ceil(K / 2)
CEven = int(K / 2)

ans = COdd * CEven
print(ans)

Fixed submission:
import math
instr = input()
K = int(instr)

COdd = math.ceil(K / 2)
CEven = int(K / 2)

ans = COdd * CEven
print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int, input().split()))

big = max(A)
small = min(A)
print(abs(big - small))


Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = N
else:
    ans = N * 2
print(ans)

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

big = max(A)
small = min(A)
print(int(big - small))


Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = N
else:
    ans = N * 2
print(ans)

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

big = max(A)
small = min(A)
print(big - small)


Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = N
else:
    ans = N * 2
print(ans)

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

big = max(A)
small = min(A)
print(big - small)


Fixed submission:
N = int(input())
if N % 2 == 0:
    ans = N
else:
    ans = N * 2
print(ans)
Buggy python submission (verdict: Runtime Error):
print(len(max(input().split('S')))

Fixed submission:
print(len(max(input().split('S'))))
Buggy python submission (verdict: Runtime Error):
n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
for i in range(k, n):
    print("Yes" if a[k + i] > a[i] else "No")

Fixed submission:
n, k = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
for i in range(k, n):
    print("Yes" if a[i] > a[i - k] else "No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])

Fixed submission:
l, r, d = [int(x) for x in input().split()]
print(r // d - (l - 1) // d)
Buggy python submission (verdict: Runtime Error):
print(sum([x % 2 for x in input().split()[::2]))

Fixed submission:
input()
print(sum([int(x) % 2 for x in input().split()[::2]]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
    	for z in range(1, 101):
      		a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])

Fixed submission:
n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])
Buggy python submission (verdict: Runtime Error):
program hi;
var 
    a: int64;
    b: real;

begin
    readln(a, b);
    writeln((a * round(b * 100)) div 100);
end.

Fixed submission:
a, b = input().split()
print(int(a) * round(float(b) * 100) // 100)
Buggy python submission (verdict: Runtime Error):
print(f"A{["B", "R"][input()[1] == "B"]}C")

Fixed submission:
print(f"A{['B', 'R'][input() == 'ABC']}C")
Buggy python submission (verdict: Runtime Error):
program hi;
var 
    a, b, c, k, i, ans: longint;
    r: array[1..200] of longint;

procedure aswap(var x: longint; var y: longint);
var tmp: longint;
begin
    if x > y then begin
        tmp := x;
        x := y;
        y := tmp;
    end;
end;

function gcd(x: longint; y: longint): longint;
var i: longint;
begin
    aswap(x, y);
    for i := 1 to y do 
        if (x mod i = 0) and (y mod i = 0) then
            gcd := i;
end;

begin
    readln(k);
    for i := 1 to k do 
        r[i] := i;
    ans := 0;
    for c := 1 to k do 
        for b := 1 to k do 
            for a := 1 to k do 
                ans := ans + gcd(gcd(r[a], r[b]), r[c]);
    writeln(ans);
end.

Fixed submission:
from math import*
r = range(1, int(input()) + 1)
print(sum(gcd(gcd(a, b), c) for a in r for b in r for c in r))
Buggy python submission (verdict: Runtime Error):
n, *a = map(int, open(0).read().split())
print(["APPROVED", "DENIED"][sum((i % 3) * (i % 5) for i in a if i % 2 == 0)])

Fixed submission:
n, *a = map(int, open(0).read().split())
print("DENIED" if sum((i % 3) * (i % 5) for i in a if i % 2 == 0) else "APPROVED")
Buggy python submission (verdict: Runtime Error):
s = list(input())
ans = 'NO'
for i in range(len(s)):
    if ''.join(s[:i] + s[n-7+i:]) == 'keyence':
        ans = 'YES'
        break
print(ans)        

Fixed submission:
s = list(input())
ans = 'NO'
for i in range(len(s)):
    if ''.join(s[:i] + s[len(s)-7+i:]) == 'keyence':
        ans = 'YES'
        break
print(ans)